configure: error: You need a C++ compiler for C++ support.[系统缺少c++环境]

一.错误
configure: error: You need a C++ compiler for C++ support.
二.安装c++ compiler
情况1.
当您的服务器能链接网络时候[联网安装gcc c++]
 

[root@localhost]# yum install -y gcc gcc-c++


情况2.
当您的服务器不能链接网络时候[不联网/离线安装gcc c++]
找到相关的安装包.
我这里是挂载的系统安装盘.系统安装盘里面有相关的安装包,如果你没有安装盘在网上下载一下包也可以[附件提供本教程相关包下载]
①挂载系统盘
 

[root@localhost]# mkdir -p /mnt/ROM[root@localhost]# mount /dev/cdrom /mnt/ROM


②切换到系统安装盘的Packages目录/mnt/ROM/Packages
 

[root@localhost]#cd /mnt/ROM/Packages


③查看gcc相关安装包
 

[root@localhost Packages]# ls gcc*
gcc-4.8.2-16.el7.x86_64.rpm      gcc-gfortran-4.8.2-16.el7.x86_64.rpm  gcc-go-4.8.2-16.el7.x86_64.rpm    gcc-objc++-4.8.2-16.el7.x86_64.rpm
gcc-c++-4.8.2-16.el7.x86_64.rpm  gcc-gnat-4.8.2-16.el7.x86_64.rpm      gcc-objc-4.8.2-16.el7.x86_64.rpm  gcc-plugin-devel-4.8.2-16.el7.x86_64.rpm
 


④安装gcc-c++即c++ compiler
 

[root@localhost Packages]# rpm -ivh gcc-c++-4.8.2-16.el7.x86_64.rpm 
warning: gcc-c++-4.8.2-16.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
	libstdc++-devel = 4.8.2-16.el7 is needed by gcc-c++-4.8.2-16.el7.x86_64


⑤安装失败,提示需要安装依赖包libstdc++-devel = 4.8.2-16.el7[版本号与您安装时候安装包相关],我们进行依赖包的查看及安装
 

root@localhost Packages]# ll libstdc++-devel*
-rw-rw-r--. 1 500 502 1556984 Jul  3  2014 libstdc++-devel-4.8.2-16.el7.i686.rpm
-rw-rw-r--. 1 500 502 1561232 Jul  3  2014 libstdc++-devel-4.8.2-16.el7.x86_64.rpm


⑥安装依赖包libstdc++-devel-4.8.2-16.el7.x86_64.rpm [版本号与您安装时候安装包相关]
 

[root@localhost Packages]# rpm -ivh libstdc++-devel-4.8.2-16.el7.x86_64.rpm 
warning: libstdc++-devel-4.8.2-16.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:libstdc++-devel-4.8.2-16.el7     ################################# [100%]


⑦再次安装gcc-c++
 

[root@localhost Packages]# rpm -ivh gcc-c++-4.8.2-16.el7.x86_64.rpm 
warning: gcc-c++-4.8.2-16.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:gcc-c++-4.8.2-16.el7             ################################# [100%]
[root@localhost Packages]# 


自此gcc-c++运行环境安装完成..

posted @ 2016-03-24 14:59  小码哥、iByte  阅读(20025)  评论(0编辑  收藏  举报