GLIBCXX_3.4.21 not found on CentOS 7

viz12 picture viz12 · May 26, 2017 · Viewed 46.5k times · Source

I recently updated my gcc version on CentOS from 4.7 to 5.4, but now I am getting the following error when I compile my program

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

I found some solutions , but I am still not able to fix the issue. 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.

Answer

SBDK8219 picture SBDK8219 · May 26, 2017

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