应用程序名称:/lib/libc.so.6:版本“GLIBC_2.8”未找到(应用程序名称要求)
命令的输出:ldd -v appname
:
linux-gate.so.1 => (0x00949000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00cea000)
libm.so.6 => /lib/libm.so.6 (0x00a83000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00ba1000)
libc.so.6 => /lib/libc.so.6 (0x0015c000)
/lib/ld-linux.so.2 (0x0012f000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00b93000)
Version information:
appname:
libm.so.6 (GLIBC_2.0) => /lib/libm.so.6
libc.so.6 (GLIBC_2.8) => not found
libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
libc.so.6 (GLIBC_2.7) => not found
libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.2.4) => /lib/libc.so.6
libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
libstdc++.so.6 (CXXABI_1.3) => /usr/lib/libstdc++.so.6
libstdc++.so.6 (GLIBCXX_3.4.5) => /usr/lib/libstdc++.so.6
libstdc++.so.6 (GLIBCXX_3.4) => /usr/lib/libstdc++.so.6
libpthread.so.0 (GLIBC_2.2) => /lib/libpthread.so.0
libpthread.so.0 (GLIBC_2.1) => /lib/libpthread.so.0
libpthread.so.0 (GLIBC_2.0) => /lib/libpthread.so.0
libpthread.so.0 (GLIBC_2.3.2) => /lib/libpthread.so.0
/lib/libpthread.so.0:
ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
/lib/libm.so.6:
ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
/usr/lib/libstdc++.so.6:
ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
libgcc_s.so.1 (GCC_4.2.0) => /lib/libgcc_s.so.1
libgcc_s.so.1 (GLIBC_2.0) => /lib/libgcc_s.so.1
libgcc_s.so.1 (GCC_3.3) => /lib/libgcc_s.so.1
libgcc_s.so.1 (GCC_3.0) => /lib/libgcc_s.so.1
libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
/lib/libc.so.6:
ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
/lib/libgcc_s.so.1:
libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.2.4) => /lib/libc.so.6
libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
appname
在Ubuntu 9.10上编译,尝试在Centos 5上运行编译后的产品。
我的猜测是Centos5的/lib /libc.so.5
提供最高版本 GLIBC_2.4,但 appname 调用 GLIBC_2.8。
但这是有趣的事情。直到我开始链接boost的系统库时,这个问题才发生。之前只是boost的线程库,现在我需要线程和系统。 我在 Ubuntu 系统上编译了 boost。 我现在将尝试在 CentOs 上编译 boost,并带来生成的 .a 文件。 顺便说一句,我正在链接到 boost .a 文件。
问题是,如何通过版本控制来减少这些类型的麻烦? 是否有人使用任何技巧,例如使用较低的库版本设置 chroot 环境,以便在其中编译产品? 显然,在较新的 Linux 发行版上进行编译很快就会使您的产品与哪怕是最旧版本的 Linux 都不兼容。 人们如何发布具有良好兼容性的二进制文件? 是的,我可以做静态链接,但是libc不能静态链接对吗?
Output for the command: ldd -v appname
:
linux-gate.so.1 => (0x00949000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00cea000)
libm.so.6 => /lib/libm.so.6 (0x00a83000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00ba1000)
libc.so.6 => /lib/libc.so.6 (0x0015c000)
/lib/ld-linux.so.2 (0x0012f000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00b93000)
Version information:
appname:
libm.so.6 (GLIBC_2.0) => /lib/libm.so.6
libc.so.6 (GLIBC_2.8) => not found
libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
libc.so.6 (GLIBC_2.7) => not found
libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.2.4) => /lib/libc.so.6
libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
libstdc++.so.6 (CXXABI_1.3) => /usr/lib/libstdc++.so.6
libstdc++.so.6 (GLIBCXX_3.4.5) => /usr/lib/libstdc++.so.6
libstdc++.so.6 (GLIBCXX_3.4) => /usr/lib/libstdc++.so.6
libpthread.so.0 (GLIBC_2.2) => /lib/libpthread.so.0
libpthread.so.0 (GLIBC_2.1) => /lib/libpthread.so.0
libpthread.so.0 (GLIBC_2.0) => /lib/libpthread.so.0
libpthread.so.0 (GLIBC_2.3.2) => /lib/libpthread.so.0
/lib/libpthread.so.0:
ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
/lib/libm.so.6:
ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
/usr/lib/libstdc++.so.6:
ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
libgcc_s.so.1 (GCC_4.2.0) => /lib/libgcc_s.so.1
libgcc_s.so.1 (GLIBC_2.0) => /lib/libgcc_s.so.1
libgcc_s.so.1 (GCC_3.3) => /lib/libgcc_s.so.1
libgcc_s.so.1 (GCC_3.0) => /lib/libgcc_s.so.1
libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
/lib/libc.so.6:
ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
/lib/libgcc_s.so.1:
libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.2.4) => /lib/libc.so.6
libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
appname
is compiled on Ubuntu 9.10, trying to run compiled product on Centos 5.
My guess is that Centos5's /lib/libc.so.5
provides up to version GLIBC_2.4, but appname calls for GLIBC_2.8.
But here's the funny thing. This problem didn't happen until I started linking to boost's system library. Before it was just boost's thread library, but now I need both thread and system.
I did compile boost on that Ubuntu system.
I'm now going to try to compile boost on CentOs, and bring over the generated .a files.
I'm linking to the boost .a files btw.
Question, how do I reduce these types of headaches with versioning?
Does any use any tricks like setting up a chroot environment with lower library versions, in which you'd compile a product?
Clearly, compiling on a newer linux distro quickly makes your product incompatible with even the slightest older version of linux.
How do people ship binaries with some decent compatibility?
Yes, I can do static linking, but libc can not be statically linked correct?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 chroot 环境是实现此目的的一种方法,但您不需要所有这些工作。您可以在某处设置较旧的 SDK 参考版本(包括 libc 和其他版本),然后强制 gcc 链接到该版本,而不是标准系统目录中的库和标头。执行此操作的 GCC 选项包括:
-isystem
、-isysroot
和--sysroot
。例如,Apple 的 gcc 经常这样做,根据您的目标操作系统版本链接到各种 SDK 版本。
Using a chroot environment is one way of doing it, but you don't need all that work. You can set up an older, reference version of your SDK (including libc and others) somewhere, and then force gcc to link against that rather than the libraries and headers in the standard system directories. The GCC options to do so are:
-isystem
,-isysroot
and--sysroot
.As an example, Apple's gcc does that very often, linking to various SDK versions depending which OS version you're targeting.
实际上,我遇到了类似的问题
/usr/lib/libc.so.6: version 'GLIBC_2.33' not found
。这是因为有新版本的 Glibc 可用。要解决此问题,您需要升级 Glibc 版本。
Actually, I encountering a similiar issue as
/usr/lib/libc.so.6: version 'GLIBC_2.33' not found
.This is because a new version of Glibc is available. To fix this, you need to upgrade your Glibc version.