473,984 Members | 57,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LNK ERROR:Using 'dlopen' in statically linked apps requires at runtime the shared lib

365 Contributor
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
Dec 2 '09 #1
12 34526
RRick
463 Recognized Expert Contributor
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.
Dec 2 '09 #2
tvnaidu
365 Contributor
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
Dec 3 '09 #3
RRick
463 Recognized Expert Contributor
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.
Dec 3 '09 #4
tvnaidu
365 Contributor
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 "segmentati on 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++
Dec 3 '09 #5
RRick
463 Recognized Expert Contributor
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.
Dec 4 '09 #6
RRick
463 Recognized Expert Contributor
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.
Dec 4 '09 #7
tvnaidu
365 Contributor
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++
Dec 4 '09 #8
tvnaidu
365 Contributor
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)
Dec 10 '09 #9
tvnaidu
365 Contributor
Looklike stack is trashing, that is why backtrace not show anything, how can I hold stack?.
Dec 10 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4761
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 in vb .net application. CODE: Friend WordGlobal_definst As Object
1
2165
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 1, in ? File "/home/world0/SWIGTEST/overturec.py", line 4, in ? import _overturec
5
1541
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 error message at runtime: An unhandled exception of type 'System.TypeLoadException' occurred in TiffLibXTester.exe Additional information: Could not load type tiff from assembly TiffLibX, Version=1.0.1425.19884, Culture=neutral,...
1
2073
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 Microsoft.Office.Core.CommandBar = App.CommandBars(BarName)
0
3446
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 fine, and can return it fine. I can have the webservice return an arraylist of the objects and consume them with no dramas. But whenever I call the method it gives this error, failing on the call, before it actually goes 'into' the function. "The...
1
2920
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 local user on the workstation is also defined with same name and password on the server (and only in the Users group on the server) Server is Windows Server 2003 running IIS 6.0 Workstation is Windows XP Professional ASP.NET 2.0 (C#) web site
1
3722
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 quickly becoming more and more urgent. I've tried the code below using the server's local Administrator user name and password. This gets me past the Access denied error but gives me a User
11
1924
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, title, price FROM '%s' WHERE itemNumber = '%s'", $_POST, $_POST);
0
2226
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) event = threading.Event() t.start_client(event) event.wait() if not t.is_active(): print 'SSH negotiation failed.'
0
10189
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
11626
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10933
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10104
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7636
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6438
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6586
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
5181
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.