Sarfaraz Nawaz
Sarfaraz Nawaz

Reputation: 361732

Working with lower version of GLIBC: version `GLIBC_2.11` not found (required by g++)

I've installed GCC 7.1 on my machine and tried to use g++ on it, but it didn't work, saying this:

g++: /lib64/libc.so.6: version `GLIBC_2.11` not found (required by g++)

So then I did these:

 $ strings /lib64/lib.so.6 | grep GLIB
 GLIBC_2.2.5
 GLIBC_2.2.6
 GLIBC_2.3
 GLIBC_2.3.2
 GLIBC_2.3.3
 GLIBC_2.3.4
 GLIBC_2.4
 GLIBC_2.5
 GLIBC_PRIVATE

 $ strings `which g++` | grep GLIB
 GLIBC_2.3
 GLIBC_2.11
 GLIBC_2.2.5

Two things can be noted here:

Questions:

1. What exactly do these strings mean? Why are there more than one string in both of them? What do they tell us?

2. My guess is that the absence of GLIBC_2.11 in libc explains why g++ doesn't work, as g++ requires it (as the error says itself). However, I'm confused what does the presence of GLIBC_2.3 in both actually mean? Does it mean that g++ can be instructed to use this instead of GLIBC_2.11? If so, how exactly? What is the command?

Upvotes: 0

Views: 2400

Answers (1)

Florian Weimer
Florian Weimer

Reputation: 33747

GLIBC_2.3 and GLIBC_2.11 are symbol versions. The dynamic linker uses them to perform a quick check for library compatibility at program startup: the system glibc must provide all symbol versions referenced by the program. Your glibc is apparently 2.5 (which would match Red Hat Enterprise Linux 5). This version lacks quite a few features added in later versions, and it turns out the pre-compiled GCC binary you are trying to run needs some of them.

To resolve this, you'll need a version of GCC compiled specifically for Red Hat Enterprise Linux 5. I haven't tried if the current GCC upstream sources build with the system compiler, which is … quite ancient by this time (although upstream still sticks with C++03 for exactly such needs). Some libstdc++ functionality may also need a newer kernel than 2.6.18, and some care is necessary to preserve compatibility between the new libstdc++ and the one installed with the system.

Upvotes: 4

Related Questions