[英]“gcc: error trying to exec 'cc1plus': execvp: No such file or directory” on CentOS 6.7
I have a really strange thing going on on my computer. 我的计算机上发生了一件非常奇怪的事情。 I did lookup for similar questions but the solutions there did not help me out.
我确实在寻找类似的问题,但是那里的解决方案并没有帮助我。
I am trying to install bazel 0.2.2b on Cent OS 6.7. 我正在尝试在Cent OS 6.7上安装bazel 0.2.2b。 Bazel requires gcc 4.8 or higher to compile so I upgraded my gcc to 4.8.2 uisng the steps given here .
Bazel需要gcc 4.8或更高版本才能编译,因此我按照此处给出的步骤将gcc升级到4.8.2。
I did an scl enable after the installation but nothing changed. 安装后我做了一个scl enable,但是没有任何改变。 My default gcc was still 4.4.7.
我的默认gcc仍然是4.4.7。 SO I did the following steps:
所以我做了以下步骤:
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++
Since removing gcc was dangerous, i moved it to another file and copied the new one into /usr/bin/gcc. 由于删除gcc很危险,因此我将其移至另一个文件,然后将新文件复制到/ usr / bin / gcc。
Now, my default gcc and g++ are both 4.8.2 but I still get the error: 现在,我的默认gcc和g ++均为4.8.2,但仍然出现错误:
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
When I do ./compile
to install Bazel. 当我做
./compile
安装Bazel时。
I tried solutions posted in other similar questions asking to upgrade/re-install but to no use. 我尝试了其他类似问题中发布的解决方案,要求升级/重新安装但无济于事。
$ 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
I am worried I might break the system core if I do anything wrong. 我担心如果做错任何事情,可能会破坏系统核心。 What should I do now?
我现在应该怎么办?
CentOS 6.8 - 64bits : CentOS 6.8-64位:
The git versiom, git clone https://github.com/bazelbuild/bazel.git
fails . git versiom,
git clone https://github.com/bazelbuild/bazel.git
失败 。
( cd bazel/ && scl enable devtoolset-2 bash && sh compile.sh
) (
cd bazel/ && scl enable devtoolset-2 bash && sh compile.sh
)
And bazel-0.2.2b fails too. bazel-0.2.2b也会失败。
The installer bazel-0.3.0-installer-linux-x86_64.sh works OK ... https://github.com/bazelbuild/bazel/releases/download/0.3.0/bazel-0.3.0-installer-linux-x86_64.sh 安装程序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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.