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++]
 c++

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


狀況2.
當您的服務器不能連接網絡時候[不聯網/離線安裝gcc c++]
找到相關的安裝包.
我這裏是掛載的系統安裝盤.系統安裝盤裏面有相關的安裝包,若是你沒有安裝盤在網上下載一下包也能夠[附件提供本教程相關包下載]
①掛載系統盤
 ruby

[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
 spa

[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[版本號與您安裝時候安裝包相關],咱們進行依賴包的查看及安裝
 code

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++
 coffeescript

[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++運行環境安裝完成..ip

相關文章
相關標籤/搜索