Skip to content
Advertisement

version `GLIBC_2.11′ not found while using gcc

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.

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

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

/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 ??

Advertisement

Answer

I copied gcc folder to the new machine.

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

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

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.

Advertisement