运行在此编译的C程序会导致在另一台服务器上找不到GLIBC库错误-是我的错还是他们的错? [英] Running a C program compiled here causes a GLIBC library not found error on another server - is it my fault or theirs?

查看:155
本文介绍了运行在此编译的C程序会导致在另一台服务器上找不到GLIBC库错误-是我的错还是他们的错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此处编译的C程序在我们的Ubuntu服务器上运行良好.但是,当其他人尝试在其特定的Linux服务器上运行它时,会出现以下错误:

A C program compiled here runs fine on our Ubuntu servers. But when a somebody else tries to run it on their particular Linux server they get the following errors:

./myprog-install: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by ./myprog-install)
./myprog-install: /lib/tls/libc.so.6: version `GLIBC_2.7' not found (required by ./myprog-install)

我需要升级我们的glibc库并重新编译吗?还是他们在服务器上丢失了某些东西?

Do I need to upgrade our glibc libraries and recompile? Or are they missing something on their server?

如果我运行apt-cache show libc6,我的Ubuntu会告诉我版本是:

If I run apt-cache show libc6 my Ubuntu tells me the version is:

Package: libc6
Priority: required
Section: libs
Installed-Size: 9368
Maintainer: Ubuntu Core developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Architecture: i386
Source: eglibc
Version: 2.11.1-0ubuntu7.10

如果我查看 http://packages.ubuntu.com/hardy/libc6 当前版本似乎是2.7-10ubuntu8.1.

If I look at http://packages.ubuntu.com/hardy/libc6 the current version appears to be 2.7-10ubuntu8.1.

我对数字感到困惑.一方面,2.11-1-0比2.7-11高.另一方面,7.10比8.1低.

I'm confused by the numbers. On the one hand 2.11-1-0 is a higher number than 2.7-11. On the other hand 7.10 is a lower number than 8.1.

这仅仅是我升级C库软件包并重新编译的问题吗?还是其他人的服务器在那里缺少一些所需的库以实现兼容性?

Is it just a matter of me upgrading the C library package and recompiling do you think? Or is the other person's server missing some needed library there for compatibility?

推荐答案

您已在glibc-2.11系统上构建.您正在尝试在具有glibc-2.3或更旧版本的系统上运行.那是行不通的.

You have built on glibc-2.11 system. You are trying to run on a system with glibc-2.3 or older. That's not going to work.

仅仅是升级C库软件包的问题

Is it just a matter of me upgrading the C library package

否:升级glibc只会使情况变得更糟.

No: upgrading your glibc will only make things worse.

您可能要尝试在此处列出的解决方案.

You may want to try solutions listed here.

这是我们可以合理要求对方升级其系统以支持而不是降级我们的编译器的东西吗?

Is this something we can reasonably request the other party to upgrade their system to support, rather than downgrade our compiler?

通常,客户端会强烈拒绝升级其系统的请求:按原样,对于他们来说,它们工作正常,并且任何升级都可能破坏其他现有应用程序.

Usually the client will strongly resist requests to upgrade their system: it's working fine for them as is, and any upgrade can break other existing applications.

如果您打算在Linux上分发二进制文件(而不是在目标系统上构建二进制文件),那么您需要学习如何制作可以在任何地方运行的二进制文件,或者您需要声明您的要求(最低内核和libc版本等),并拒绝不能满足这些要求的客户.

If you are planning to distribute binaries on Linux (as opposed to building them on the target system), then you need to learn how to make binaries that will run everywhere, or you need to state your requirements (minimum kernel and libc versions, etc.) and turn clients who can't meet these requirements away.

更新:

为什么会出现两个错误.他们为什么不只为GLIBC_2.11.1买一个,这显然是我建造的?

Why did they get two errors. Why didn't they just get one for GLIBC_2.11.1 which is apparently what I built with?

符号版本控制不能那样工作.

Symbol versioning doesn't work that way.

引入新符号后,会用 current libc版本进行标记,例如readdir64@@GLIBC_2.2posix_spawn@@GLIBC_2.15

When a new symbol is introduced, it is marked with the current libc version, e.g. readdir64@@GLIBC_2.2, posix_spawn@@GLIBC_2.15, etc.

当您链接同时使用上述两个符号的程序时,请尝试在例如glibc-2.1系统,您将收到两个错误.

When you link a program that uses both of the above symbols, and try to run it on e.g. glibc-2.1 system, you would get two errors.

但是,如果您链​​接的程序使用上述任何符号,例如

But if you link a program that doesn't use any of the above symbols, e.g.

int main() { return 0; }

然后您的程序将运行,没有任何错误.

then your program will just run without any errors.

更新2:

他们不必将GLIBC_2.4和GLIBC2.7都添加到他们的Linux系统中,对吗?

they don't have to add both GLIBC_2.4 and GLIBC2.7 to their Linux system, do they?

不,他们没有. GLIBC_2.11中将包含所有先前的符号.实际上,即使他们愿意,他们也无法同时安装 和glibc-2.4以及2.7:很难同时安装多个版本,并且不可能在默认位置安装了多个版本.

No, they don't. The GLIBC_2.11 will have all the previous symbols in it. In fact, they couldn't install both glibc-2.4 and 2.7 even if they wanted to: it is quite difficult to have multiple versions installed at the same time, and impossible to have multiple versions installed in default location.

这篇关于运行在此编译的C程序会导致在另一台服务器上找不到GLIBC库错误-是我的错还是他们的错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆