当前位置: 技术问答>linux和unix
新手求助,在red hat编译c++遇到command notfound如何解决?
来源: 互联网 发布时间:2017-05-26
本文导语: 求助~~~~~~~~~~~~~~~~~急 1,请问这种情况是不是要下载g++安装包安装,如果是的话要下载哪个版本的g++安装包?用什么命令来安装? 2.百度说gcc也能编译c++程序,为何会出现error trying to exec ‘cc1plus'(图中第四行)的问题...如何...
求助~~~~~~~~~~~~~~~~~急
1,请问这种情况是不是要下载g++安装包安装,如果是的话要下载哪个版本的g++安装包?用什么命令来安装?
2.百度说gcc也能编译c++程序,为何会出现error trying to exec ‘cc1plus'(图中第四行)的问题...如何解决?
3.还有我是用vmware虚拟机的,可不可以在windows下下载了安装包再放去虚拟机linux里面运行?
问题有点多,新手第一次linux编c++,求指教,感激不尽~~~
|
Your command is all right.
Unfortunately, you can't install gcc-c++, in fact you can't yum anything. The reason is that you installed a RedHat Enterprise Linux, which is not free. You will have to pay for the subscription(yum). Backup your personal belongings and install a new VM using centOS, which is almost as same as RHEL, but free.
GCC standards for GNU Compiler Collection. When you compile cpp, it will invoke g++. The reason you can't invoke g++ through gcc is probably because the gcc package you installed doesn't contain the support to c++.
There are some subtle differences that you may want to know, for instance, gcc will not link std C++ libraries by default (but g++ will do it).
As for downloading package separately on windows and then install on VM, don't waste your time on a RHEL. Try CentOS, then you will never have to worry about yum update...
Unfortunately, you can't install gcc-c++, in fact you can't yum anything. The reason is that you installed a RedHat Enterprise Linux, which is not free. You will have to pay for the subscription(yum). Backup your personal belongings and install a new VM using centOS, which is almost as same as RHEL, but free.
GCC standards for GNU Compiler Collection. When you compile cpp, it will invoke g++. The reason you can't invoke g++ through gcc is probably because the gcc package you installed doesn't contain the support to c++.
There are some subtle differences that you may want to know, for instance, gcc will not link std C++ libraries by default (but g++ will do it).
As for downloading package separately on windows and then install on VM, don't waste your time on a RHEL. Try CentOS, then you will never have to worry about yum update...