Error Loading Shared Library Undefined Symbol
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you linux shared library undefined symbol might have Meta Discuss the workings and policies of this ldd undefined symbol site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers unresolved-symbols-in-shared-libs or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community
Shared Object Undefined Symbol
of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Linux shared library that uses a shared library undefined symbol up vote 10 down vote favorite 5 two shared libraries liba.so and libb.so. liba.so uses libb.so. All c files are compiled with -fPIC. Linking uses dlopen error undefined symbol -shared. When we call dlopen on liba.so it cannot find symbols in libb.so...we get the "undefined symbol" error. We can dlopen libb.so with no errors. We know that liba is finding libb because we don't get a file not found error. We get a file not found error when we delete libb.so. We tried -lutil and no luck. Any ideas???? oh yeah. gcc 4.1.2 update: We use rpath when linking liba so it can find libb. ldd liba.so returns: linux-gate.so.1 => (0xffffe000) libb.so => ./libb.so (0xf6ef9000) <-------- LIBB libutil.so.1 => /lib/libutil.so.1 (0xf6ef5000) libdl.so.2 => /lib/libdl.so.2 (0xf6ef1000) libm.so.6 => /lib/libm.so.6 (0xf6ec9000) libpthread.so.0 => /lib/libpthread.so.0 (0xf6eb1000) librt.so.1 => /lib/librt.so.1 (0xf6ea8000) libc.so.6 => /lib/libc.so.6 (0xf6d62000) /lib/ld-linux.so.2 (0x007d0000) is it significat that there is no .# at the end of libb??? linux gcc shared share|improve this question edited Jun 7 '10 at 18:35 asked Jun 7 '10 at 17:09 johnnycrash 2,82112030 1 You are saying: you created two libs (-fPIC -shared), liba.so
here for a quick overview of the site Help Center Detailed answers to any .so undefined symbol c++ questions you might have Meta Discuss the workings and policies
Shared Library Undefined Reference
of this site About Us Learn more about Stack Overflow the company Business Learn more about
Undefined Symbol In .so File
hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow http://stackoverflow.com/questions/2991572/linux-shared-library-that-uses-a-shared-library-undefined-symbol is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Undefined symbol when loading a shared library up vote 1 down vote favorite In my program I need to load a shared library dynamically with dlopen(). Both the program and http://stackoverflow.com/questions/29175308/undefined-symbol-when-loading-a-shared-library the shared library are successfully cross-compiled for an ARM architecture with the cross-compiler installed on my x86. However, whenever the program tries to load the library at run time on ARM, it fails giving this error: undefined symbol: _dl_hwcap I cannot find the culprit of this error. Let me give details on how the shared library (libmyplugin.so) is built on x86 first. I use the g++ cross-compiler as below: /home/me/arm/gcc-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -march=armv7-a -mfloat-abi=hard -c -s -fPIC -o build/module1.o module1.cpp /home/me/arm/gcc-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -march=armv7-a -mfloat-abi=hard -c -s -fPIC -o build/module2.o module2.cpp /home/me/arm/gcc-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -o dist/libmyplugin.so build/module1.o build/module2.o --sysroot /home/me/arm/sysroot/ -Wl,--no-as-needed -ldl -lX11 -lXext /home/me/arm/libstatic.a -shared -s -fPIC Please pay attention to the following notes: module1.cpp and module2.cpp are my source code files. libstatic.a is a big archive of object .o files implementing the stuff directly invoked/referenced by module1.cpp and module2.cpp. These object files have been compiled by others for the same ARM architecture as mine, with the same c
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this http://stackoverflow.com/questions/1617286/easy-check-for-unresolved-symbols-in-shared-libraries site About Us Learn more about Stack Overflow the company Business Learn more http://stackoverflow.com/questions/13479679/unable-to-load-shared-library-undefined-symbols 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 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 Easy check undefined symbol for unresolved symbols in shared libraries? up vote 47 down vote favorite 18 I am writing a fairly large C++ shared-object library, and have run into a small issue that makes debugging a pain: If I define a function/method in a header file, and forget to create a stub for it (during development), since I am building as a shared object library rather than an shared library undefined executable, no errors appear at compile-time telling me I have forgotten to implement that function. The only way I find out something is wrong is at runtime, when eventually an application linking against this library falls over with an 'undefined symbol' error. I am looking for an easy way to check if I have all the symbols I need at compile time, perhaps something I can add to my Makefile. One solution I did come up with is to run the compiled library through nm -C -U to get a demangled list of all undefined references. The problem is this also comes up with the list of all references that are in other libraries, such as GLibC, which of course will be linked against along with this library when the final application is put together. It would be possible to use the output of nm to grep through all my header files and see if any of the names corresponding.. but this seems insane. Surely this is not an uncommon issue and there is a better way of solving it? c++ linker shared-libraries share|improve this question edited Jun 13 '14 at
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more 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 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 Unable to load shared library: undefined symbols up vote 0 down vote favorite I have my own program with plugins (dynamic shared libraries) on a linux (ubuntu) system. My libraries (plugins) use OpenCV (maybe not so important). My plugins are in /usr/local/lib/mysoft/. I have compiled my program successfully even with libraries, successfully installed so everything seems to be OK up to this point. When I run my program, it loads a bunch of these libraries based on some configuration file. I have several libraries which are loaded successfully but I cannot load one library. It gives me error when loading (used dlopen() to open the library): /usr/local/lib/mysoft/libMyPlugin2.so: undefined symbol: _ZN2cv6resizeERKNS_11_InputArrayERKNS_12_OutputArrayENS_5Size_IiEEddi Segmentation fault (core dumped) Tue Nov 20 19:11:29 CET 2012 It obviously has some problems to find cv::resize which is part of OpenCV but I don't understand why. I checked following things: OpenCV is probably correctly installed since other libraries use it as well and are loaded without problems no dependencies of my program, libMyPlugin2.so or OpenCV are missing (checked with ldd) Architecture of all libraries and binaries seems to be the same (I checked it with objdump -f) Does anybody have an idea what am I doing wrong? This post seems to be so relevant but still didn't help: Linux shared library that uses a shared library undefined symbol c linux opencv dynamic-linking undefined-symbol share|improve this question edited Nov 21 '12 at 10:00 asked Nov 20 '12 at 18:25 bubo 1011110 You might have several versions of OpenCV installed and a wrong version is chosen at run time. –Andrey Kamaev Nov 20 '12