如題, 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