CentOS 7编译安装gcc 4.9.4

1. 为什么要升级到gcc4.9.x呢?

因为最近在做的一个项目中要用C++11新特性,而在 g++ 4.9 之前,regex 库并不支持 ECMAScript 的正则语法,换句话说,在 g++4.9 之前,g++ 对 C++11 标准库的支持并不完善,为保证本次项目的顺利进行,故将 g++ 版本升级至 4.9 以上。

2. 不是g++,而是gcc?

G++ is no longer a separate distribution. Version 2 of G++ is an integral
part of GCC. You should get the gcc-2.n.tar.gz sources (where n is the
highest numbered archive) in the gcc/ directory.

C++ users will almost certainly need to retrieve the libstdc+±2.n.tar.gz
distribution as well, since that’s where all the standard C++ stream classes
(and header files like iostream.h) live.

3. 安装过程:

3.1. 下载源码:
wget ftp://mirrors.kernel.org/gnu/gcc/gcc-4.9.4/gcc-4.9.4.tar.bz2

其他版本:mirrors.kernel.org/gnu/gcc

3.2. 解压文件:
tar -jxvf gcc-4.9.4.tar.bz2
3.3. 下载编译所需依赖项:

进入文件夹

cd gcc-4.9.4
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值