GLIBCXX_3.4.21 not found on CentOS 7

I recently upgraded my version of gcc on CentOS from 4.7 to 5.4, but now I get the following error when compiling my program

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

I have found several solutions , but I am still not able to solve the problem. These are the paths I found with whereis gcc

 gcc: /usr/bin/gcc /usr/lib/gcc /usr/local/bin/gcc /usr/local/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz 

and used this libstdc package for CentOS.

+7
source share
2 answers

Try export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/lib64:/usr/lib64

+12
source

I did not have sudo access to my CentOS machine, so I installed gcc with conda. If you installed gcc with conda, the above answer will not work. check the gcc installation path as:

$ which gcc

output: /home/ags/miniconda3/envs/GE/bin/gcc

This indicates that gcc is installed in the GE conda environment, now export LD_LIBRARY_PATH as the path to the lib directory of this environment.

export LD_LIBRARY_PATH=/home/ags/miniconda3/envs/GE/lib:$LD_LIBRARY_PATH

Hope this helps.

0
source

Source: https://habr.com/ru/post/1268260/


All Articles