关于centos:Your-compiler-does-not-have-the-necessary-C17-support

11次阅读

共计 405 个字符,预计需要花费 2 分钟才能阅读完成。

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

正文完
 0