关于centos:Your-compiler-does-not-have-the-necessary-C17-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

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理