Dlopen Symbol Lookup Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have dlopen error undefined symbol Meta Discuss the workings and policies of this site About Us dlopen error undefined symbol root Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with dlopen symbol not found us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers,
Dlopen Undefined Symbol C++
just like you, helping each other. Join them; it only takes a minute: Sign up dlopen() gives unresolved symbol error when .so tries to use a class from the main executable. Why? up vote 2 down vote favorite I'm on Linux, the question is concerning shared objects of C++ classes. The problem comes when my shared symbol lookup error perl objects try to use resources linked into the main executable. I have the following codes: loader.cpp: #include
here for a quick overview of the site Help Center Detailed answers to symbol lookup error undefined symbol linux any questions you might have Meta Discuss the workings and
Symbol Lookup Error /usr/lib64/libgdk-x11-2.0.so.0 Undefined Symbol _xgetrequest
policies of this site About Us Learn more about Stack Overflow the company Business Learn more
Symbol Lookup Error /usr/lib/libxrender.so.1 Undefined Symbol _xgetrequest
about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community http://stackoverflow.com/questions/8536880/dlopen-gives-unresolved-symbol-error-when-so-tries-to-use-a-class-from-the-ma Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up When look up symbol, the program doesn't search from the correct library up vote 3 down vote favorite I'm adding two classes and libraries to a system, http://stackoverflow.com/questions/12945514/when-look-up-symbol-the-program-doesnt-search-from-the-correct-library parent.so and child.so deriving from it. The problem is when the program is loading child.so it cannot find parent's virtual function's definition from parent.so. What happens, nm -D child.so will gives something like (I just changed the names) U _ZN12PARENT15virtualFunctionEv The program will crash running _handle = dlopen(filename, RTLD_NOW|RTLD_GLOBAL); //filename is child.so it'll give an error with LD_DEBUG = libs symbol lookup error: undefined symbol: _ZN12PARENT15virtualFunctionEv (fatal) The thing I cannot explain is, I tried LD_DEBUG = symbols using GDB, when running dlopen, the log shows it tried to look up basically in all libaries in the system except parent.so, where the symbol is defined. But from libs log parent.so is already loaded and code is run, and it is at the same path of all other libraries. ...... 27510: symbol=_ZN12PARENT15virtualFunctionEv; lookup in file=/lib/tls/libm.so.6 27510: symbol=_ZN12PARENT15virtualFunctionEv; lookup in file=/lib/tls/libc.so.6 27510: symbol=_ZN12PARENT15virtualFunctionEv; lookup in file=/lib/ld-linux.so.2 27510: child.so: error: symbol lookup error: undefined symbol
Java, SQL, and other programming languages here. Search Forums Show Threads Show Posts Tag Search Advanced Search Unanswered http://www.unix.com/programming/126317-dynamic-library-load-dlopen.html Threads Find All Thanked Posts Go to Page... learn linux and unix commands - unix shell scripting Dynamic library load with dlopen Programming Thread Tools Search this Thread Display Modes #1 12-18-2009 shade82 Registered User Join Date: Dec 2009 Last Activity: 21 December 2009, 11:53 AM undefined symbol EST Location: Italy Posts: 3 Thanks: 0 Thanked 0 Times in 0 Posts Dynamic library load with dlopen Hi, I created two library libsum.so and libproduct.so. In the libproduct.so is defined function "product" that use function "sum" defined in libsum.so. So libproduct depends on libsum. In main function I called product function by a dlopen request. symbol lookup error Unfortunaly, when I execute program I have an error: symbol lookup error, undefined symbol sum. Why this? I don't open sum function with another dlopen request. This solution resolve problem but is, in generally, a bad solution because the main function developer can not say that product depends on sum. Is there another solution? Plese help me, Thanks to all and nice week-end. I paste code below. Code: /* sum.c */ #include