Your compiler does not have the necessary C++17 support!

如题, CentOS编译安装时可能提示以下错误, 需要升级GCC版本

configure: error: Your compiler does not have the necessary C++17 support! Cannot proceed.

执行命令:

yum install -y centos-release-scl
yum install devtoolset-8-gcc*

完成后执行:

切换当前会话中gcc版本为8

scl enable devtoolset-8 bash

或者:

直接替换旧的gcc

mv /usr/bin/gcc /usr/bin/gcc-4.8.5
ln -s /opt/rh/devtoolset-8/root/bin/gcc /usr/bin/gcc
mv /usr/bin/g++ /usr/bin/g++-4.8.5
ln -s /opt/rh/devtoolset-8/root/bin/g++ /usr/bin/g++

执行命令查看版本:

gcc -v

你可能感兴趣的:(centosgcc)