" gcc:错误尝试执行' cc1plus':execvp:没有这样的文件或目录"在CentOS 6.7上

时间:2016-06-24 16:22:35

标签: linux gcc g++ centos6 bazel

我的计算机上发生了一件非常奇怪的事情。我确实查找了类似的问题,但那里的解决方案并没有帮助我。

我正在尝试在Cent OS 6.7上安装bazel 0.2.2b。 Bazel需要gcc 4.8或更高版本才能编译,所以我将gcc升级到4.8.2,使用here给出的步骤。

我在安装后启用了scl,但没有任何改变。我的默认gcc仍然是4.4.7。所以我做了以下步骤:

sudo mv /usr/bin/gcc /usr/bin/gcc.bak
sudo cp /opt/rh/devtoolset-2/root/usr/bin/gcc /usr/bin/gcc
sudo mv /usr/bin/g++ /usr/bin/g++.bak
sudo cp /opt/rh/devtoolset-2/root/usr/bin/g++ /usr/bin/g++

由于删除gcc很危险,我将其移动到另一个文件并将新文件复制到/ usr / bin / gcc。

现在,我的默认gcc和g ++都是4.8.2,但我仍然得到错误:

gcc: error trying to exec 'cc1plus': execvp: No such file or directory

当我./compile安装Bazel时。

我尝试过在其他类似问题中发布的解决方案,要求升级/重新安装 但是没用。

$ yum install gcc-c++
Loaded plugins: fastestmirror, refresh-packagekit, security
You need to be root to perform this command.
[sree@ds1 bazel]$ sudo yum install gcc-c++
[sudo] password for sree:
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.atlanticmetro.net
 * epel: mirror.cs.princeton.edu
 * extras: mirror.cc.columbia.edu
 * updates: centos.mirror.constant.com
Package gcc-c++-4.4.7-17.el6.x86_64 already installed and latest version
Nothing to do

我担心如果我做错了什么我可能会破坏系统核心。我现在应该怎么做?

1 个答案:

答案 0 :(得分:0)

CentOS 6.8 - 64bits:

git versiom,git clone https://github.com/bazelbuild/bazel.git 失败

cd bazel/ && scl enable devtoolset-2 bash && sh compile.sh

而且bazel-0.2.2b也失败了。

安装程序bazel-0.3.0-installer-linux-x86_64.sh工作正常...... https://github.com/bazelbuild/bazel/releases/download/0.3.0/bazel-0.3.0-installer-linux-x86_64.sh

su    
sh bazel-0.3.0-installer-linux-x86_64.sh