使用gcc时找不到版本`GLIBC_2.11'

时间:2022-04-08 06:59:56

I have problem using gcc/g++ after I changed the machine I use, I installed gcc-4.9.2 in my previous machine, when I moved to the new machine, I copied gcc folder to the new machine.

我在更改我使用的机器后使用gcc / g ++时遇到问题,我在之前的机器上安装了gcc-4.9.2,当我移动到新机器时,我将gcc文件夹复制到新机器上。

When I try to use I get this error :

当我尝试使用时,我收到此错误:

/data/obenchek/gcc-4.9.2/bin/g++: /lib64/libc.so.6: version `GLIBC_2.11' not found (required by /data/obenchek/gcc-4.9.2/bin/g++)

I have already checked this question : `GLIBC_2.11' not found

我已经检查了这个问题:找不到“GLIBC_2.11”

If it says right, the version of libc and g++ are not compatible , libc version :

如果说得对,libc和g ++的版本不兼容,libc版本:

/lib/libc.so.6                                            
GNU C Library stable release version 2.4 (20090904), by Roland McGrath et al.
...

So I should reinstall gcc completely or there is a easier way to resolve this ??

所以我应该完全重新安装gcc还是有一种更简单的方法来解决这个问题?

1 个解决方案

#1


I copied gcc folder to the new machine.

我将gcc文件夹复制到新机器上。

That's your problem: don't copy, install appropriate GCC package instead.

这是你的问题:不要复制,而是安装适当的GCC包。

Most UNIX systems, including Linux, guarantee backward compatibility: a binary compiled on an older system continues to run on a newer one.

大多数UNIX系统(包括Linux)都保证了向后兼容性:在旧系统上编译的二进制文件继续在较新的系统上运行。

The reverse is not true: a binary compiled on a newer system often will not run on an older one. This is working "as designed".

反之亦然:在较新系统上编译的二进制文件通常不会在较旧的系统上运行。这是“按设计”工作。

In this particular instance, you copied GCC compiled with GLIBC-2.11 or newer to a machine that has GLIBC-2.10 or older. And that doesn't work.

在此特定实例中,您将使用GLIBC-2.11或更高版本编译的GCC复制到具有GLIBC-2.10或更早版本的计算机。这不起作用。

#1


I copied gcc folder to the new machine.

我将gcc文件夹复制到新机器上。

That's your problem: don't copy, install appropriate GCC package instead.

这是你的问题:不要复制,而是安装适当的GCC包。

Most UNIX systems, including Linux, guarantee backward compatibility: a binary compiled on an older system continues to run on a newer one.

大多数UNIX系统(包括Linux)都保证了向后兼容性:在旧系统上编译的二进制文件继续在较新的系统上运行。

The reverse is not true: a binary compiled on a newer system often will not run on an older one. This is working "as designed".

反之亦然:在较新系统上编译的二进制文件通常不会在较旧的系统上运行。这是“按设计”工作。

In this particular instance, you copied GCC compiled with GLIBC-2.11 or newer to a machine that has GLIBC-2.10 or older. And that doesn't work.

在此特定实例中,您将使用GLIBC-2.11或更高版本编译的GCC复制到具有GLIBC-2.10或更早版本的计算机。这不起作用。