查找 libstdc 中缺失的符号++在 Debian/squeeze 上

发布于 2024-08-27 23:05:14 字数 1058 浏览 10 评论 0原文

我正在尝试使用作为 .so 文件提供的预编译库。

该文件动态链接到一些库:

$ 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)

不幸的是,在 Debian/squeeze 中,没有 libstdc++-libc6.1-1.so.* 文件。 只有 libstdc++6 软件包提供的 libstdc++.so.* 文件。

我尝试将 libstdc++-libc6.1-1.so.2 链接(使用 ln -s)到 libstdc++.so.6 文件。它不起作用,当我尝试使用此库查找我的 .o 文件时,似乎缺少一批符号。

/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)'

你会怎么办 ?我如何找到这些符号导出到哪个库?

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 ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

迷荒 2024-09-03 23:05:14

谷歌说你需要 libstdc++2.9-glibc2.1

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

虽然它来自过时的 debian 版本,但我不确定安装它是否是一个好主意。

编辑

其实我是出于好奇才尝试的。它没有造成任何损害,并且似乎与标准 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

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

拥醉 2024-09-03 23:05:14

尝试以下方法:

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

然后寻找 istrstream。这可能会相当慢。

Try something along the lines of:

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

Then hunt for istrstream. This could be rather slow.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文