gcc源码编译安装成功的疑问

CalvinLu 2017-10-22 05:59:00
我当前系统的linux版本是gcc-4.4.7,然后我重新源码编译了gcc-4.8.1,安装在/usr/local/gcc-4.8.1。
当我要编译YouCompleteMe插件的时候,使用这个命令进行编译

cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/download/clang+llvm . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp

然后出现错误

[lujiawen@ljwServer ycm_build]$ sudo cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/download/clang+llvm . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- NOTE: You appear to be on CentOS. In order to use this application, you require a more modern compiler than the default compiler on this platform. Please install the devtoolset-6 or greater. For example, see this link: https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/
CMake Error at CMakeLists.txt:224 (message):
Your C++ compiler does NOT fully support C++11.

而且我的PATH路径已经添加了gcc-4.8.1的执行路径,也使用命令source ~/.bash_profile重新加载了
但是,cmake的时候,他还是去查找旧版本的gcc,当我把旧版本的gcc删除的时候,他就显示没有找到编译器。
哪位大哥能给我一点提示吗?谢谢
...全文
558 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
幽饮烛 2017-10-25
  • 打赏
  • 举报
回复
设置 CC 和 CXX 两个变量就行了。
LubinLew 2017-10-23
  • 打赏
  • 举报
回复
通常 /usr/bin/gcc 是软连接, 你把这软链接 指向 4.8.1的gcc即可
zhxianbin 2017-10-23
  • 打赏
  • 举报
回复
$PATH 确定下路径是不是有了

23,118

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧