开发者

Finding missing symbols in libstdc++ on Debian/squeeze

开发者 https://www.devze.com 2022-12-25 09:54 出处:网络
I开发者_如何学编程\'m trying to use a pre-compiled library provided as a .so file. This file is dynamically linked against a few librairies :

I开发者_如何学编程'm trying to use a pre-compiled library provided as a .so file.

This file is dynamically linked against a few librairies :

$ ldd  /usr/local/test/lib/libtest.so
linux-gate.so.1 =>  (0xb770d000)
libstdc++-libc6.1-1.so.2 => not found
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb75e1000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7499000)
/lib/ld-linux.so.2 (0xb770e000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb747c000)

Unfortunately, in Debian/squeeze, there is no libstdc++-libc6.1-1.so.* file. Only a libstdc++.so.* file provided by the libstdc++6 package.

I tried to link (using ln -s) libstdc++-libc6.1-1.so.2 to the libstdc++.so.6 file. It does not work, a batch of symbols seems to be lacking when I'm trying to ld my .o files with this lib.

/usr/local/test/lib/libtest.so: undefined reference to `__builtin_vec_delete'
/usr/local/test/lib/libtest.so: undefined reference to `istrstream::istrstream(int, char const *, int)'
/usr/local/test/lib/libtest.so: undefined reference to `__rtti_user'
/usr/local/test/lib/libtest.so: undefined reference to `__builtin_new'
/usr/local/test/lib/libtest.so: undefined reference to `istream::ignore(int, int)'

What would you do ? How may I find in which lib those symbols are exported ?


Google says that you need libstdc++2.9-glibc2.1

http://linux.derkeiler.com/Mailing-Lists/Debian/2005-07/0755.html

Although it's from obsolete debian release and I'm not sure if it's such a good idea to install it.

Edit

Actually I tried it out of curiosity. It didn't do any harm and seem to coexist well with standard libstc++.so

debian:/home/dmitry# ll /usr/lib/\*stdc\*
-rw-r--r-- 1 root root 256240 2000-02-19 17:41 /usr/lib/libstdc++-2-libc6.1-1-2.9.0.so
lrwxrwxrwx 1 root root     30 2010-03-31 15:54 /usr/lib/libstdc++-libc6.1-1.so.2 -> libstdc++-2-libc6.1-1-2.9.0.so
lrwxrwxrwx 1 root root     19 2010-01-21 10:13 /usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.13
-rw-r--r-- 1 root root 958628 2010-01-08 11:39 /usr/lib/libstdc++.so.6.0.13


wget http://archive.debian.org/debian/pool/main/e/egcs1.1/libstdc++2.9-glibc2.1_2.91.66-4_i386.deb

dpkg -i libstdc++2.9-glibc2.1_2.91.66-4_i386.deb


Try something along the lines of:

`find /lib -type f | xargs nm | less`

Then hunt for istrstream. This could be rather slow.

0

精彩评论

暂无评论...
验证码 换一张
取 消