简体   繁体   English

如何修复“版本`GLIBC_2.14'未找到”错误?

[英]How do I fix a “version `GLIBC_2.14' not found” error?

I've compiled a C program under Ubuntu 12.04, built a Debian package out of it, and want to install it on a server running Debian Lenny. 我在Ubuntu 12.04下编译了一个C程序,用它构建了一个Debian软件包,并希望在运行Debian Lenny的服务器上安装它。

Last time I did that (about two months ago) it worked: I could install the package and run the binary. 上次我这样做(大约两个月前)它工作:我可以安装包并运行二进制文件。 But now I get the following error message: 但现在我收到以下错误消息:

(binary's name): /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by (binary's name))

Other than upgrading my machine to Ubuntu 12.4, the only significant change we've brought to the code is a call to strdup() , for which I had to enable the _POSIX_C_SOURCE=200809L feature test macro. 除了将我的机器升级到Ubuntu 12.4之外,我们为代码带来的唯一重大改变是调用strdup() ,我必须启用_POSIX_C_SOURCE=200809L功能测试宏。

Upgrading the server to the latest Debian version is not my preferred option as it is not under my direct control. 将服务器升级到最新的Debian版本不是我的首选选项,因为它不在我的直接控制之下。

How do I fix this problem? 我该如何解决这个问题?

I think the critical bit of info here is 'upgrading my machine'. 我认为这里的关键信息是'升级我的机器'。 So when this worked before, you were building and packaging on something earlier than 12.04? 所以当这个工作之前,你在12.04之前的东西上建造和包装? If so, then the issue is that 12.04 now ships with a newer version of libc (apparently 2.14), and your binary now records a dependency on that version of libc. 如果是这样,那么问题是12.04现在附带了更新版本的libc(显然是2.14),你的二进制文件现在记录了对该版本libc的依赖。 When you try to run on Lenny, which likely uses an older version of libc, the linker detects that the Lenny version does not support the 2.14 API, and fails. 当您尝试在可能使用较旧版本的libc的Lenny上运行时,链接器会检测到Lenny版本不支持2.14 API,并且失败。

I think the best way forward is probably to do your development and testing on 12.04, and then when you want to create packages for a specific Debian release, use pbuilder or similar to create debs. 我认为最好的方法可能是在12.04进行开发和测试,然后当你想为特定的Debian版本创建软件包时,使用pbuilder或类似方法来创建debs。 This will ensure that the libraries used for the packaging build match the target platform. 这将确保用于打包构建的库与目标平台匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM