CentOS 通过yum安装gcc 4.8, 4.9, 5.2等高版本GCC

gcc 4.8 安装

curl -Lks http://www.hop5.in/yum/el6/hop5.repo > /etc/yum.repos.d/hop5.repo
yum install gcc gcc-g++
gcc --version

gcc 4.9 安装

yum install centos-release-scl
yum install devtoolset-3-toolchain
scl enable devtoolset-3 bash
gcc --version

gcc 5.2 安装

yum install centos-release-scl
yum install devtoolset-4-toolchain
scl enable devtoolset-4 bash
gcc --version

scl enable devtoolset-3 bash只是临时覆盖系统原有的GCC引用,如果想永久覆盖,可在root/.bashrc文件中添加source /opt/rh/devtoolset-3/enable

文章来自参考:https://www.dwhd.org/20160724_085212.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值