已解决centos下CMAKE编译报gcc版本冲突
CMake Error at CMakeLists.txt:39 (project):
The CMAKE_C_COMPILER:
/usr/bin/c
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:39 (project):
The CMAKE_CXX_COMPILER:
/usr/bin/c
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:39 (project):
The CMAKE_ASM_COMPILER:
/usr/bin/cc
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
解决方法:
方法1、在gcc安装之前先卸载历史版本,避免2个版本并存的问题
#先卸载
$yum remove gcc -y
$yum erase gcc
#安装
$ sudo yum install centos-release-scl -y
$ sudo yum install devtoolset-7-gcc* -y
$ scl enable devtoolset-7 bash #Run for each time or add this line into the ~/.bashrc file
$ which gcc
$ gcc --version
######1、查找系统中的gcc文件,并逐个目录检查相关版本 gcc --version,找到低版本目录,并替换低版本的执行文件路径、建立新版本的软连接
$find / -name gcc #
/opt/rh/devtoolset-7/root/usr/libexec/gcc
/opt/rh/devtoolset-7/root/usr/lib/gcc
/opt/rh/devtoolset-7/root/usr/bin/gcc #7.3.1-5
/usr/libexec/gcc
/usr/lib/gcc
/usr/bin/gcc #4.8.5
解决办法:
$mv /usr/bin/gcc /usr/bin/gcc4.8.5
$ln -s /opt/rh/devtoolset-7/root/usr/bin/gcc /usr/bin/gcc
同理:还需要处理c 、g 、cc的
结果:按照这种方式处理后还有些问题,后来改成了方式1来处理,基本解决了,不再报错
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /boutique/detail/tanhiacaki
-
photoshop保存的图片太大微信发不了怎么办
PHP中文网 06-15 -
word里面弄一个表格后上面的标题会跑到下面怎么办
PHP中文网 06-20 -
photoshop扩展功能面板显示灰色怎么办
PHP中文网 06-14 -
《学习通》视频自动暂停处理方法
HelloWorld317 07-05 -
Android 11 保存文件到外部存储,并分享文件
Luke 10-12 -
TikTok加速器哪个好免费的TK加速器推荐
TK小达人 10-01 -
微信公众号没有声音提示怎么办
PHP中文网 03-31 -
excel下划线不显示怎么办
PHP中文网 06-23 -
excel打印预览压线压字怎么办
PHP中文网 06-22 -
微信运动停用后别人还能看到步数吗
PHP中文网 07-22