CentOS下g++: command not found问题的解决

2017年02月27日 18:09:06 阅读数:5174 标签: centosgcc 更多

个人分类: 问题分析
 
版权声明:本文章是作者辛勤书写的成果,如需转载,请与作者联系,并保留作者信息以及原文链接,谢谢~~ https://blog.csdn.net/blueheart20/article/details/58173190

1. 问题的提出

在安装extundelete的过程中,发现在configure过程中,出错了,具体的错误信息如下:

  1.  
    configure:2865: g++ --version >&5
  2.  
    ./configure: line 2867: g++: command not found
  3.  
    configure:2876: $? = 127
  4.  
    configure:2865: g++ -v >&5
  5.  
    ./configure: line 2867: g++: command not found
  6.  
    configure:2876: $? = 127
  7.  
    configure:2865: g++ -V >&5
  8.  
    ./configure: line 2867: g++: command not found
  9.  
    configure:2876: $? = 127
  10.  
    configure:2865: g++ -qversion >&5
  11.  
    ./configure: line 2867: g++: command not found
  12.  
    configure:2876: $? = 127
  13.  
    configure:2896: checking whether the C++ compiler works
  14.  
    configure:2918: g++ conftest.cpp >&5
  15.  
    ./configure: line 2920: g++: command not found
  16.  
    configure:2922: $? = 127
  17.  
    configure:2960: result: no
  18.  
    configure: failed program was:
  19.  
    | /* confdefs.h */
  20.  
    | #define PACKAGE_NAME "extundelete"
  21.  
    | #define PACKAGE_TARNAME "extundelete"
  22.  
    | #define PACKAGE_VERSION "0.2.4"
  23.  
    | #define PACKAGE_STRING "extundelete 0.2.4"
  24.  
    | #define PACKAGE_BUGREPORT "extundelete.sourceforge.net"
  25.  
    | #define PACKAGE_URL ""
  26.  
    | #define PACKAGE "extundelete"
  27.  
    | #define VERSION "0.2.4"
  28.  
    | /* end confdefs.h. */
  29.  
    |
  30.  
    | int
  31.  
    | main ()
  32.  
    | {
  33.  
    |
  34.  
    | ;
  35.  
    | return 0;
  36.  
    | }
  37.  
    configure:2965: error: in `/root/extundelete-0.2.4':
  38.  
    configure:2967: error: C++ compiler cannot create executables
  39.  
    See `config.log' for more details

经过分析,发现其中的关键错误信息是:

 g++: command not found

g++马上就脑补为gc++的编译器是不是没有安装呀? 估计是的,按图索骥,安装看看。

2.  安装以及解决

由于本人使用的OS环境为centos, 其默认的包管理工具为yum, 故按照依赖包:

  1.  
    yum -y update gcc
  2.  
    yum -y install gcc+ gcc-c++

执行上述命令之后,可以返现gcc相关命令都按照成功了,故问题解决。

3. 总结分析

默认情况下,centos并未按照gcc相关的编译命令,如果在安装软件之时,有时候需要从源代码编译开始,进行安装;此时就需要gcc的命令支持。

【亲测】<g++/gcc>CentOS下g++: command not found问题的解决(c++环境安装)的更多相关文章

  1. Centos下忘记mysql的root密码的解决方法

    Centos下忘记mysql的root密码的解决方法 一:(停掉正在运行的mysql) [root@NetDakVPS ~]# service mysql stop 二:使用 “--skip-gran ...

  2. centos下wget: command not found的解决方法

    今天给服务器安装新LNMP环境时,wget 时提示 -bash:wget command not found,很明显没有安装wget软件包.一般linux最小化安装时,wget不会默认被安装,这里是C ...

  3. 一起学ASP.NET Core 2.0学习笔记(一): CentOS下 .net core2 sdk nginx、supervisor、mysql环境搭建

    作为.neter,看到.net core 2.0的正式发布,心里是有点小激动的,迫不及待的体验了一把,发现速度确实是快了很多,其中也遇到一些小问题,所以整理了一些学习笔记: 阅读目录 环境说明 安装C ...

  4. centos下svn的主要常用命令(解决商城系统添加的文件无法自动更新至svn服务器)

    问题描述: 在商城中通过网页上传的png文件无法自动添加到版本库中. 查找过程: 通过程序分析,增加的主要是数据文件,主要分布在data目录中. svn list /home/ggg --depth= ...

  5. 【亲测有效】Centos安装完成docker后启动docker报错docker: unrecognized service的两种解决方案

    今天在学习Docker的时候 使用yum install docker安装完后启动不了,报错如下: [root@Sakura ~]# service docker start docker: unre ...

  6. [亲测!超级简单] Centos 安装Python3.6环境

    配置好Python3.6和pip3安装EPEL和IUS软件源 yum install epel-release -y yum install https://centos7.iuscommunity. ...

  7. Centos下找不到eth0设备的解决方法

    问题描述: ifconfig命令无法找到eth0设备,且/etc/sysconfig/network-scripts/中只有ifcfg-lo文件,而没有ifcfg-eth0. 临时解决方法一: 使用命 ...

  8. CENTOS下Python 升级后YUM无法使用的解决办法

    Python有很多实用的工具,安装依赖python版本较高,升级Python后导致yum无法使用. 原因: 系统自带的yum依赖Python老版本,升级后不兼容 解决办法: 1. 列出所有版本,确定老 ...

  9. centos下MySQL Workbench连接时崩溃的解决方法

    在centos6.5中使用MySQL Workbench 6.3.8链接数据库崩溃,如果是在终端使用命令“mysql-workbench”打开的话会有如下错误提示: /usr/libexec/mysq ...

随机推荐

  1. TFLearn 与 Tensorflow 一起使用

    好用的不是一点点..=-=.. import tensorflow as tf import tflearn import tflearn.datasets.mnist as mnist # Usin ...

  2. [LeetCode&Python] Problem 830. Positions of Large Groups

    In a string S of lowercase letters, these letters form consecutive groups of the same character. For ...

  3. 给电脑换源 npm 国内镜像 cnpm

    (1)通过 config 配置指向国内镜像源 npm config set registry http://registry.cnpmjs.org //配置指向源 npm info express   ...

  4. unet网络讲解,附代码

    转: http://www.cnblogs.com/gujianhan/p/6030639.html key1: FCN对图像进行像素级的分类,从而解决了语义级别的图像分割(semantic segm ...

  5. odoo软件名称及授权协议的变化

    先看一张表格 起步时叫TinyERP,微小的ERP:发展中期叫做OpenERP,开放的ERP:历经10年积累的软件,客户群,开发支持用户群,开始构筑自己的商业模式.到8版本,改名为Odoo.同时,软件 ...

  6. PS学习之餐饮行业修图

    素材 红烧肉 生菜 洋葱 目标效果 开始操作: 首先打开PS,将红烧肉素材放入  将红烧肉单另扣下来(用快随选择工具 按住Alt键是减选  抠图时  将画布放大 细细的扣) 然后创建一个和当前选区大小 ...

  7. JAVA 实用插件

    一.alibaba开发规约插件 https://p3c.alibaba.com/plugin/eclipse/update 下载地址 alibaba是个优秀的公司,这个插件能很好的规范代码,推荐给大家 ...

  8. Go Example--原子计数器

    package main import ( "fmt" "runtime" "sync/atomic" "time" ) ...

  9. Python知识点整理,基础4 - 集合操作

  10. 枚举 Java Enumeration接口

    Enumation 定义了一些方法,通过这些方法可以枚举对象集合中的元素 如: boolean hasMoreElements() 测试此枚举是否包含更多的元素 object nextElement( ...