1. 程式人生 > >Centos 7 編譯安裝 gcc-5.5

Centos 7 編譯安裝 gcc-5.5

==========運維之路

  • 環境如下
[[email protected] ~]# cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core) 
[[email protected] ~]# systemctl status firewalld.service 
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset:
enabled) Active: inactive (dead) Docs: man:firewalld(1) [[email protected] ~]# getenforce Disabled
  • 錯誤發生
[[email protected] server]# bin/LobbyServer --conf=LobbyServer.cfg --log_dir=/data/logs/LobbyServer
bin/LobbyServer: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by bin
/LobbyServer) bin/LobbyServer: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by bin/LobbyServer) bin/LobbyServer: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by bin/LobbyServer)
  • 查詢問題
[[email protected] server]# strings /usr/lib64/libstdc++.so.6 | egrep "GLIBCXX|CXXABI"
GLIBCXX_3.4.16 GLIBCXX_3.4.17 GLIBCXX_3.4.18 GLIBCXX_3.4.19 #最高版本為GLIBCXX_3.4.19 CXXABI_1.3.4 CXXABI_1.3.5 CXXABI_1.3.6 CXXABI_1.3.7 #最高版本為CXXABI_1.3.7 CXXABI_TM_1 GLIBCXX_DEBUG_MESSAGE_LENGTH [[email protected] server]# gcc --version gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
  • 升級版本
#軟體下載地址 http://ftp.gnu.org/gnu/gcc/
#這裡下載的是gcc-5.5 版本
[[email protected] server]# wget http://ftp.gnu.org/gnu/gcc/gcc-5.5.0/gcc-5.5.0.tar.gz