Updating libstdc++.so.6 to GLIBCXX_3.4.21 and CXXABI_1.3.9 after updating to gcc 7.3
Asked Answered
I

1

7

I have a RHEL server (Maipo), and I did the Installing gcc 7.3 (gcc 7.3.0) - released 01/25/2018. For installing gcc, I followed How to Install gcc 5.3 with yum on CentOS 7.2?

However, when installing some software I need (that require gcc>4.9) still I am having issues with the g++ libraries. I had assumed that compiling gcc as indicated should have provided the right libraries? But I am getting:

/lib64/libstdc++.so.6: version CXXABI_1.3.9' not found 
/lib64/libstdc++.so.6: versionGLIBCXX_3.4.21' not found

That are still in the 4.8.5 version of g++ (libstdc++.so.6.0.19 - it is the only version there). I checked, and does not reach the 1.3.9 and 3.4.21.

Due to my subscription to RedHat (academic server), I cannot access the developer tool pack - the one available for me goes back to gcc 4.8.5.

If anybody has any idea of how to solve this, I would really appreciate your help. And apologies if it sounds stupid.

Ita answered 12/4, 2018 at 13:33 Comment(0)
D
7

I also have built gcc 7.3 from sources. My example program name is consolehost.

I've done following:

>ldd ./consolehost
./consolehost: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by ./consolehost)
./consolehost: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./consolehost)
        linux-vdso.so.1 =>  (0x00007ffd79916000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8458cfc000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f84589f4000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f84586f1000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f84584db000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f8458118000)
        /lib64/ld-linux-x86-64.so.2 (0x0000556169234000)

Then I've investigated that:

>ls -ali /lib64/libstdc++.so.6
37631 lrwxrwxrwx. 1 root root 19 мар 17 06:38 /lib64/libstdc++.so.6 -> libstdc++.so.6.0.19

I've figured out that I need version that fresher that 6.0.19. So

>sudo find / -name "libstdc++.so.6*"
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.19
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.py
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.pyc
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.pyo
/usr/local/lib64/libstdc++.so.6.0.24
/usr/local/lib64/libstdc++.so.6
/usr/local/lib64/libstdc++.so.6.0.24-gdb.py
/home/declspec/gcc_build/stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.24
/home/declspec/gcc_build/stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6
/home/declspec/gcc_build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.24
/home/declspec/gcc_build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6
/home/declspec/gcc_build/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.24
/home/declspec/gcc_build/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6

In that moment I need to copy libstdc++.so.6.0.24 to /lib64/ and make new Symbolic link.

sudo mv /lib64/libstdc++.so.6 /lib64/libstdc++.so.6.orig
sudo ln -s /lib64/libstdc++.so.6.0.24 /lib64/libstdc++.so.6

That helps me. Hope that helps to you too. This link decribes GLIBCXX, but I did not understand how this works and what's a porpose (why versions is not enough)

Dutiful answered 21/4, 2018 at 8:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.