摘要:本文主要向大家介绍了 C/C++知识点之【亲测】CentOS下g++: command not found问题的解决(c++环境安装),通过具体的内容向大家展示,希望对大家学习C/C++知识点有所帮助。
本文主要向大家介绍了 C/C++知识点之【亲测】CentOS下g++: command not found问题的解决(c++环境安装),通过具体的内容向大家展示,希望对大家学习C/C++知识点有所帮助。
1. 问题的提出
在安装extundelete的过程中,发现在configure过程中,出错了,具体的错误信息如下:
configure:2865: g++ --version >&5
./configure: line 2867: g++: command not found
configure:2876: $? = 127
configure:2865: g++ -v >&5
./configure: line 2867: g++: command not found
configure:2876: $? = 127
configure:2865: g++ -V >&5
./configure: line 2867: g++: command not found
configure:2876: $? = 127
configure:2865: g++ -qversion >&5
./configure: line 2867: g++: command not found
configure:2876: $? = 127
configure:2896: checking whether the C++ compiler works
configure:2918: g++ conftest.cpp >&5
./configure: line 2920: g++: command not found
configure:2922: $? = 127
configure:2960: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "extundelete"
| #define PACKAGE_TARNAME "extundelete"
| #define PACKAGE_VERSION "0.2.4"
| #define PACKAGE_STRING "extundelete 0.2.4"
| #define PACKAGE_BUGREPORT "extundelete.sourceforge.net"
| #define PACKAGE_URL ""
| #define PACKAGE "extundelete"
| #define VERSION "0.2.4"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2965: error: in `/root/extundelete-0.2.4‘:
configure:2967: error: C++ compiler cannot create executables
See `config.log‘ for more details
经过分析,发现其中的关键错误信息是:
g++: command not found
g++马上就脑补为gc++的编译器是不是没有安装呀? 估计是的,按图索骥,安装看看。
2. 安装以及解决
由于本人使用的OS环境为centos, 其默认的包管理工具为yum, 故按照依赖包:
yum -y update gcc
yum -y install gcc+ gcc-c++
执行上述命令之后,可以返现gcc相关命令都按照成功了,故问题解决。
3. 总结分析
默认情况下,centos并未按照gcc相关的编译命令,如果在安装软件之时,有时候需要从源代码编译开始,进行安装;此时就需要gcc的命令支持。
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标编程语言C/C+频道!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号