How to solve error on CentOS "/lib64/libstdc++.so.6 version GLIBCXX_3.4.xx not found"
Posted onDisqus:
My personal server uses CentOS 7.9, and there are often strange errors when deploying some AI applications. For example, recently, an error was reported when deploying an application:
1
/lib64/libstdc++.so.6: version GLIBCXX_3.4.xx not found
Online search for solutions, there are different opinions, either reinstall gcc, or recompile and install libstdc++,export LD_LIBRARY_PATH and so on. Several attempts have failed, and there is no way to upgrade the os version. Finally, a suitable solution is found, and it’s worked for me.
Find and display all packages that provide libstdc++.so.6 as a library file through yum
1
sudo yum provides libstdc++.so.6
Download new version libstdc.so.
NOTICE: Since I need version 3.4.22+, so I can just update it to 3.4.26. Other versions are the same.
1 2 3
cd /usr/local/lib64 sudo wget http://www.vuln.cn/wp-content/uploads/2019/08/libstdc.so_.6.0.26.zip unzip libstdc.so_.6.0.26.zip
Copy libstdc++.so.6.0.26 to /usr/lib64
1 2
cp libstdc++.so.6.0.26 /usr/lib64 cd /usr/lib64
Check the soft link version of libstdc++.so.6,
1
ls -l | grep libstdc++
It may shows like this:
1
libstdc++.so.6 ->libstdc++.so.6.0.19
Remove /usr/lib64 original link libstdc++.so.6, you can backup it before remove.