https://www.cnblogs.com/NanZhiHan/p/11010130.html
https://blog.csdn.net/lianshaohua/article/details/83411684
https://blog.csdn.net/jacky128256/article/details/98034172
https://www.cnblogs.com/jixiaohua/p/11732225.html
在centos上通过yum直接安装最新版gcc和开发工具
参考下面
https://blog.csdn.net/weixin_34186950/article/details/92484762
方法一
yum install centos-release-scl scl-utils-build
#sudo yum install centos-release-scl -y
yum list all --enablerepo='centos-sclo-rh'
yum list all --enablerepo='centos-sclo-rh' | grep "devtoolset-"
#sudo yum install devtoolset-8 -y
#yum install devtoolset-8-gcc devtoolset-3-gcc-c++
#yum install devtoolset-8-gcc* -y
安装8版本的gcc、gcc-c++、gdb工具链(toolchian):
yum install -y devtoolset-7-toolchain
#之后每次登陆终端,默认还是4.8,如果需要切换到8.3.1,执行以下切换命令即可:
scl enable devtoolset-8 bash
# source /opt/rh/devtoolset-8/enable
可以将对应版本的切换命令写个shell文件放在配了环境变量的目录下,需要时随时切换,或者开机自启
~/.bashrc中。
https://blog.csdn.net/xiaoxinyu316/article/details/44834255
rpm -qa | grep glibc
rpm -qi glibc
ldd --version
ll /lib64/libc.so.6
strings /lib64/libc.so.6 | grep LIBC
yum whatprovides libstdc++.so.6
方法二
cd /usr/local/src
wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-8.3.0/gcc-8.3.0.tar.gz
cd gcc
./contrib/download_prerequisites
#下载不下来报错 mpfr-3.1.4.tar.bz2 from ftp://gcc.gnu.org/pub/gcc/infrastructure/
#去http://mirror.hust.edu.cn/gnu/mpfr/下载gmp-6.1.0.tar.bz2,mpc-1.0.3.tar.gz,isl-0.18.tar.bz2
#http://isl.gforge.inria.fr/
yum -y install flex
mkdir build
cd build
../configure --prefix=/usr/local/gcc --enable-languages=c,c++ --disable-multilib
make #建议使用单任务make,不要使用多任务,多任务有可能会编译报错。
make install
mv /usr/bin/gcc /usr/bin/gcc_old
ln -s /usr/local/gcc/bin/gcc /usr/bin/gcc
mv /usr/bin/g++ /usr/bin/g++_old
ln -s /usr/local/gcc/bin/g++ /usr/bin/g++
gcc --version
g++ --version
ll /lib64/libc.so.6
rwxrwx. 1 root root 12 12月 21 2017 /lib64/libc.so.6 -> libc-2.17.so
linux 不同gcc编译的库和运行时库的版本兼容问题
https://blog.csdn.net/yubing841026/article/details/80609655?utm_source=blogxgwz8
在centos上安装最新的glibc
https://blog.csdn.net/zhangpeterx/article/details/96116219
在CentOS/Debian/Ubuntu上编译安装最新版gnu make 和GNU 'binutils' (as and ld)
https://blog.csdn.net/zhangpeterx/article/details/96135667
gcc升级后更新libstdc++.so.6动态库
https://blog.csdn.net/na_beginning/article/details/53413997?utm_source=blogxgwz7
centos7.5 解决缺少libstdc++.so.6库的原因及解决办法
https://www.cnblogs.com/effortsing/p/10363921.html