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.

Leo
  • 71
  • 1
  • 1
  • 6

2 Answers2

6

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)

FunctorPrototype
  • 1,173
  • 2
  • 12
  • 24
-4

Aerospace engineer here..just upgrade you gcc version 9..every problem will be solve. https://linuxize.com/post/how-to-install-gcc-compiler-on-ubuntu-18-04/ follow this..

shoaib
  • 1
  • 2
    A link to a solution is welcome, but please ensure your answer is useful without it: [add context around the link](//meta.stackexchange.com/a/8259) so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. [Answers that are little more than a link may be deleted.](/help/deleted-answers) – Sabito stands with Ukraine Nov 15 '20 at 16:32