当前位置: 技术问答>linux和unix
新手求助,在red hat编译c++遇到command notfound如何解决?
来源: 互联网 发布时间:2017-05-26
本文导语: 求助~~~~~~~~~~~~~~~~~急 1,请问这种情况是不是要下载g++安装包安装,如果是的话要下载哪个版本的g++安装包?用什么命令来安装? 2.百度说gcc也能编译c++程序,为何会出现error trying to exec ‘cc1plus'(图中第四行)的问题...如何...
![新手求助,在red hat编译c++遇到command notfound如何解决?[图片]](/img/tech-article-img/img_1418387190_501945.jpeg)
求助~~~~~~~~~~~~~~~~~急
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...
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。