首页 > 应用开发 > C/C++ > 技术分享| gcc版本升级到5.2
## 下载源码包 [root@localhost ~]# yum -y install bzip2 gcc* gdb wget [root@localhost ~]# wget http://mirrors.concertpass.com/gcc/releases/gcc-5.2.0/gcc-5.2.0.tar.bz2 ## 无网情况下手动下载上传到服务器
## 解压 [root@localhost ~]# tar -jxvf gcc-5.2.0.tar.bz2 [root@localhost ~]# cd gcc-5.2.0 ## 安装依赖 [root@localhost gcc-5.2.0]# ./contrib/download_prerequisites
[root@localhost gcc-5.2.0]# mkdir gcc-build-5.2.0 [root@localhost gcc-build-5.2.0]# cd gcc-build-5.2.0 [root@localhost gcc-build-5.2.0]# ../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
[root@localhost gcc-build-5.2.0]# make -j4
[root@localhost gcc-build-5.2.0]# make install
[root@localhost gcc-build-5.2.0]# gcc -v [root@localhost gcc-build-5.2.0]# g++ -v
[root@localhost gcc-build-5.2.0]# reboot
[root@localhost ~]# gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/5.2.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib Thread model: posix gcc version 5.2.0 (GCC)
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70013909/viewspace-2996544/ ,如需转载,请注明出处,否则将追究法律责任。