Understanding the gcc version and the GLIBC, GLIBCXX versions in more detail
Asked Answered
J

2

21

Assume I have the following local gcc, g++ version:

$ gcc -v
$ g++ -v
gcc version 6.3.1

I don't understanding the relation and meaning of the following compared to my compiler version:

What is this referring to?

/usr/lib64/libstdc++.so.6

Trying to run a binary and I get this error, what is GLIBCXX_3.4.20 referring to? why is the number starting with 3?

/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found

What is all this?

$ strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19

How about the ldd version?

ldd --version
ldd (GNU libc) 2.17

I can't link all these version numbers together.

Jinx answered 26/6, 2019 at 22:4 Comment(1)
gcc.gnu.org/onlinedocs/libstdc++/manual/abi.htmlPentaprism
L
14

I can't link all these version numbers together.

As already mentioned in the comments, the ABI page tells you the relationship between GLIBCXX_... and g++ versions. GLIBCXX_3.4.20 corresponds to g++-4.9.0.

Since you have g++-6.3.1, you should have a version of libstdc++.so.6 with GLIBCXX_3.4.22 in it, but you clearly don't.

It looks like you have multiple versions of libstdc++.so.6: one in /lib64 and another in /usr/lib64. I am guessing that one of them is old, and shouldn't be on the system at all.

P.S. The version of GLIBC has nothing to with your problem, and is irrelevant.

Lacedaemonian answered 29/6, 2019 at 2:36 Comment(0)
A
3

GLIBC_ and GLIBCXX_ symbol versions have no intrinsic relationship. GLIBC_ belongs to glibc, and GLIBCXX_ to libstdc++. libstdc++ can be built against many different glibc versions, and this can result in different GLIBC_ version references, but the set of GLIBCXX_ versions is not changed by that.

Aposematic answered 6/7, 2019 at 10:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.