Ldd Undefined Symbol Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss linux shared library undefined symbol the workings and policies of this site About Us Learn more shared library undefined reference to function about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow
Unresolved-symbols-in-shared-libs
Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each
Undefined Symbol In .so File
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 -shared. When we call dlopen on liba.so it cannot find symbols in libb.so...we .so undefined symbol c++ 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 and libb.so. liba.so is dinamically linked (or it should be...) with libb.so and uses it. In a program X you try dlopen on libb.so and everything
here for a quick overview of the site Help Center Detailed answers to
Undefined Symbol _zn
any questions you might have Meta Discuss the workings and policies dlopen undefined symbol of this site About Us Learn more about Stack Overflow the company Business Learn more gcc no-undefined 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 http://stackoverflow.com/questions/2991572/linux-shared-library-that-uses-a-shared-library-undefined-symbol Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ldd says library isn't found by compile completes successfully up vote 5 down vote favorite 3 I am attempting to compile project. It compiles successfully. My make command http://stackoverflow.com/questions/16345590/ldd-says-library-isnt-found-by-compile-completes-successfully exits with a status code of 0 and there are no errors displayed. However, the project is not working, and when I run ldd -d
ASP.NET Apache-MySQL-PHP AMPPS MAMP Java CSharp Orchard CMS Mac Impressum About me Linux: C++ lookup error - undefined https://benohead.com/linux-c-lookup-error-undefined-symbol/ symbol Posted on June 22, 2012June 22, 2012 by hb At a customer site, we had a C++ program (renamed for the purpose of this http://arstechnica.com/phpbb/viewtopic.php?f=20&t=387832 blog to myprogram) which was failing after running for some time. It's a program processing messages from an external system and seemed to fail only when undefined symbol the processing of the message triggered some given operations. The error message was: lookup error: /home/xxx/bin/xxx/myprogram: undefined symbol: _Z22CxxxPxxxExxxPxxxR6CDBManRKSsRSt6vectorISsSaISsEE The first thought was to use ldd to check whether everything was fine: # ldd myprogram linux-gate.so.1 => (0xffffe000) libxxx230.so => not found libmc3adv.so => not found libsybdb.so => not found libxxxutl.so shared library undefined => not found libxxxdb.so => not found libxxxcustom.so => not found libxerces-c.so.23 => not found libdl.so.2 => /lib/libdl.so.2 (0x4001e000) libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x40022000) libm.so.6 => /lib/tls/libm.so.6 (0x400df000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40101000) libc.so.6 => /lib/tls/libc.so.6 (0x40109000) /lib/ld-linux.so.2 (0x40000000) So many not found ! Ok I must have forgotten something… Of course, LD_LIBRARY_PATH is probably not set in my shell: # pidof myprogram 10132 # export `cat /proc/10132/environ | strings | grep LD_LIBRARY_PATH` pidof return the id of the process running the specified program /proc/10132/environ contains the whole environment of the specified process strings is required to convert the 0x00 separated strings of /proc/xxx/environ The rest just gets the line LD_LIBRARY_PATH=… and uses export to set it in my shell as well Now I have the same LD_LIBRARY_PATH as the process running myprogram and can rerun ldd: ldd myprogram linux-gate.so.1 => (0xffffe000) libxxx230.so => /home/xxx/libs/libxxx230.so (0x40018000) libmc3adv.so => /home/xxx/libs/libmc3adv.so (0x40051000) libsybdb.so => /opt/sy