I am getting this link error, I am using mongoose web server with Linux, any idea?:
mongoose.c:3114: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
mongoose.c:3081: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
12 33858
I assume you are supplying a shared library to the server. This user supplied shared library might need other shared libraries. You have to make sure the server can access all of the shared libraries, including the compiler shared libraries like stdc++, and probably lib c.
The system variable LD_LIBRARY_PATH is the usual way to tell the server where to find all of the shared libraries. You directory add paths to it separated by semi-colons(;). You might have to restart the server.
I need to set LD_LIBRARY_PATH before I run the executable.
Right now I made all static libs instead shared libs, also I am supplying -static flag to create execubale, do I need to remove that -static flag, also I supply path /opt/lib where I kept all static libs.
finally executable creates, but I gets this "dlopen", if I takeout -static flag , then it goes away, these two messages not coming
I need to set LD_LIBRARY_PATH before I run the executable.
Yes, you do. LD_LIBRARY_PATH can also be used with the compiler for linking in shared libraries.
The -static flag says don't use the C/C++ shared libraries. I don't suggest anyone using the static flag for any application. I had similar crash and burns problems when using it.
In your case, some library is using a shared library that dlopen can't find. I suspect its either lib c or stdc++. Put these paths in your LD_LIBRARY_PATH and I suspect the problem will go away.
I just takeout -static flag and I rebuild again, then I did set LD_LIBRARY_PATH and then I run my app, I am getting "segmentation fault",but if I use -static flag back and recompile again, in this case, I gets that "dlopen" warning, but my app runs without any segmentation fault, but still when compile without -static flag earlier, I am passing some static libs with -l optioon, since I made all my libs as static libs instead dynamic libs, except few system libs also I am linking here which are mentioned below, in your previous post, you mentioned -static is not a good option, right now if I use that option only, I can get my app running, otherwise seg. fault coming (in this case, after I set LD_LIB PATH, if I do "ldd my-own-app", then I can see beloe shared libs since I am linking these. but with -static option how big risk it is, if I release my app to customer?
these system shared libs I am linking:
-ldl -ltinyxml -lpthread -lm -lstdc++
With the static flag I had unexplained crash and burn problems with a program. Once we went back to the C++ shared library, these problems went away. That's as far as I went with it. Like you, I go with what works.
You have a couple of choices here. You can hunt down the dlopen problem. Using ldd on your executable should tell you where to look. strace might help too.
You can hunt down the seg fault. This looks like a separate issue from the dlopen and will probably have to be addressed anyway. My guess is that the dlopen problem occurs before the seg fault. The debugger is a good place to check for this problem.
With the static flag I had unexplained crash and burn problems with a program. Once we went back to the C++ shared library, these problems went away. That's as far as I went with it. Like you, I go with what works.
You have a couple of choices here. You can hunt down the dlopen problem. Using ldd on your executable should tell you where to look. strace might help too.
You can hunt down the seg fault. This looks like a separate issue from the dlopen and will probably have to be addressed anyway. My guess is that the dlopen problem occurs before the seg fault. The debugger is a good place to check for this problem.
right now I gets that dlopen message during linking only, with -static flag I am able to build executable on Linux, I am able to run that. but that image was built with static libs.
I just changed all static libs to shared libs, I build again on Linux, I tried to run that, I gets seg. fault as soon as I run, I think the other image built with static libs is much better, I can run, also I can communicate with peer, ultimately I don't want to use static libs, I need to use shared libs, but with shared libs, I gets this issue, I just started with gdb, I did backtrace, it doesn't show anything.
am I missing any standard shared libs, right now I am linking these:
-ldl -lpthread -lm -lstdc++
I have everything works with static libs, I converted all static libs to shared lib (-shared flag), I get segmentation fault. also I set LD_LIBRARY_PATH. It crashes immediately. backtrace shows only one line below. also ldd shows all shared libs.
(gdb) run
Starting program: ~/config/vmal
Program received signal SIGSEGV, Segmentation fault.
0x00000001 in ?? ()
(gdb) backtrace
#0 0x00000001 in ?? ()
(gdb)
Looklike stack is trashing, that is why backtrace not show anything, how can I hold stack?.
Did you turn on the compiler debug flag -g (or -g3) flag? Also, if you have stripped out all symbolic info, you won't get any trace info.
The other problem might be the system you are using. I had problems with cgywin and the debug information. If you are using a "normal" linux distro, this shouldn't be a problem.
Well, I turned -g option for every file, also when I do "ldd final-prog", it shows all shared libs.
when I build my final executable using shared libs, I just replaced static with shared in makefile, also I have .a files availbale for static and .so files available for shared.
I did small test, when I remove one library linking for static, I got many undef symbols, final exe file didn't built, the same test I did for shared, everytime execubale builts no matter whether I have all shared lib linking with -l option or not, looklike final exe file built with shared libs is faked one?. do I need anything else besides -shared instead -static in Makefile?.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: rwalker |
last post by:
Error number 429 - COM object with CLSID
{000209F0-0000-0000-C000-000000000046} is either not valid or not
registered.
Intermittent occurance of this error. Using Word.Global to run word
macro...
|
by: satish |
last post by:
Hello all,
I have a python module generated by SWIG. When I try to import the moduleI
get the following error :
>>> import overturec
Traceback (most recent call last):
File "<stdin>", line...
|
by: Ladvánszky Károly |
last post by:
I'm trying to use a statically linked C library. I've wrapped a .NET C++ DLL
around this lib and trying to drive the wrapper from a .NET VB testbed. The
whole build succeeds but I get the following...
|
by: ns2k |
last post by:
I add reference office.dll and Microsoft Office Excel Component to my
project and use :
---------------------------------------
Dim App As Excel.Application, BarName as String
...
Dim Bar As...
|
by: Steven |
last post by:
I'm having trouble using an arraylist of a custom object as an argument in a
webservice, everything is in VB.Net. Visual Studio
I can pass the custom object as an argument to other webmethods...
|
by: lecnac |
last post by:
Here's some details:
Server and workstation both in the same workgroup
Logged into server as local Administrator
Logged into workstation as a local user that is only in the Users group
The...
|
by: lecnac |
last post by:
Sorry for the repost. I must have done something wrong when I tried to post
my reply (I can't seem to find it).
Anyway, I'd really appreciate any help that anyone could provide. My issue
is...
|
by: Frankie |
last post by:
Hello:
New user here...first post to group.
I'm getting an SQL syntax error when I try to run the following query:
$query = sprintf("SELECT itemNumber, entryDate, modifyDate, thumbnailURL,...
|
by: sa6113 |
last post by:
I am using this code to connect to a windows machine using paramiko, I have
installed sshd on the machine and it works properly:
sock.connect((hostname, port))
t = paramiko.Transport(sock)...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
| |