CentOS yum 安装 g++ 4.7.2 & c++11
From this answer to "Install gcc 4.7 on CentOS [6.x]", the easiest way to get g++ 4.7, and the required tools and libraries, for CentOS 5.x is via the devtools package:
cd /etc/yum.repos.d
wget http://people.centos.org/tru/devtools/devtools.repo
yum --enablerepo=testing-devtools-5 install devtoolset-1.0
Since you're running g++ manually (as opposed to through make), you'll need to update your $PATHvariable so your shell will use the new gcc, g++, etc. binaries:
export PATH=/opt/centos/devtoolset-1.0/root/usr/bin/:$PATH
At this point, your g++ should be version 4.7.0
$ g++ --version
g++ (GCC) 4.7.0 20120507 (Red Hat 4.7.0-5)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Be aware that installing gcc and associated tools and libraries in this manner relies on the repository maintainer to keep their packages up to date.
If you're interested in keeping your gcc up to date, you may want to consider building gcc from source.
Also, compiling programs with a different version of g++ and libstdc++ than are installed on your system can cause all kinds of Fun, coping with which is beyond the scope of this answer. It may be worth moving to a Linux distribution that has support for what you're doing.
CentOS yum 安装 g++ 4.7.2 & c++11的更多相关文章
- centos 怎么安装 g++
		
centos 怎么安装 g++ 找了n久 找到一个实用的 有gcc 但是 是老版本的 tarball 编译 nmap 的时候说机器没有g++ 各种方法都试过 然后 找到下面这个方法: cento ...
 - centos yum 安装 mongodb 以及php扩展
		
centos yum 安装 mongodb 以及php扩展 投稿:hebedich 字体:[增加 减小] 类型:转载 MongoDB是一个基于分布式文件存储的数据库.由C++语言编写.旨在为WEB应用 ...
 - 【转】CentOS yum安装和卸载软件的使用方法
		
在CentOS yum安装和卸载软件的使用方法安装方法安装一个软件时. CentOS yum -y install httpd安装多个相类似的软件时 CentOS yum -y install ...
 - CentOS yum 安装LAMP PHP5.4版本
		
CentOS yum 安装LAMP PHP5.4版本 [日期:2015-06-04] 来源:Linux社区 作者:rogerzhanglijie [字体:大 中 小] Linux系统版本:C ...
 - CentOS yum安装mcrypt
		
CentOS yum安装mcrypt 本篇排错的前提是只想用yum安装,不想使用源码包编译安装. php依赖一下包: #yum install libmcrypt libmcrypt-deve ...
 - CentOS yum安装mcrypt详细图解教程
		
CentOS yum安装mcrypt详细图解教程 在Linux的发行版CentOS 6.3 系统下,LAMP(Linux+Apache+Mysql+php)环境搭建好后发现PHPMyadmin提示 “ ...
 - centos yum 安装php5.6
		
centos yum 安装php5.6 卸载 php之前的版本: yum remove -y php-common 配置源 CentOS 6.5的源 rpm -Uvh http://ftp.iij.a ...
 - redhad借用CentOs yum 安装
		
RedHat linux 默认是安装了yum软件的,但是由于激活认证的原因让redhat无法直接进行yum安装一些软件,如果我们需要在redhat下直接yum安装软件,我们只用把yum的源修改成Cen ...
 - linux centos yum安装LAMP环境
		
centos 6.5 1.yum安装和源代码编译在使用的时候没啥区别,但是安装的过程就大相径庭了,yum只需要3个命令就可以完成,源代码需要13个包,还得加压编译,步骤很麻烦,而且当做有时候会出错,源 ...
 
随机推荐
- thinkphp 配置参考
			
惯例配置 应用设定 'APP_USE_NAMESPACE' => true, // 应用类库是否使用命名空间 3.2.1新增 'APP_SUB_DOMAIN_DEPLOY' => fals ...
 - linux 创建多级目录 mkdir -p
			
原文地址:http://www.dutor.net/index.php/2010/06/cmd-mkdir-p/ mkdir的-p选项允许你一次性创建多层次的目录,而不是一次只创建单独的目录.例如,我 ...
 - Xen的半虚拟化(Paravirtualization)
			
三个特权级 IA-32体系提供了4个特权级别,正常情况下只用了2个, 操作系统运行在Ring 0,而应用程序运行在Ring 3. Xen让自己运行在Ring 0, 而操作系统运行在Ring 1, 应用 ...
 - Django框架(十二)—— 补充:inclusion_tag、defer、only、choice、事务、创建多对多的第三张表
			
目录 补充:inclusion_tag.defer.only.choice.事务.创建多对多的第三张表 一.inclusion_tag 1.作用 2.使用 二.defer与only 1.定义 2.使用 ...
 - Lambda表达式演变历史
			
/// <summary> /// 爬虫委托 /// </summary> /// <param name="crawlerCode">爬虫编码 ...
 - NIO 源码分析(04) 从 SelectorProvider 看 JDK SPI 机制
			
目录 一.SelectorProvider SPI 二.SelectorProvider 加载过程 2.1 SelectorProvider 加载 2.2 Windows 下 DefaultSelec ...
 - 0 ‘+new Array(017)’ 输出? js+相当于Number()类型转换
			
网站搬迁,给你带来的不便敬请谅解! http://www.suanliutudousi.com/2017/10/20/new-array017-%E8%BE%93%E5%87%BA%EF%BC%9F- ...
 - Python面试题之阅读下面的代码,写出A0,A1至An的最终值
			
A0 = dict(zip(('a','b','c','d','e'),(1,2,3,4,5))) A1 = range(10) A2 = [i for i in A1 if i in A0] A3 ...
 - 拓展KMP求回文串
			
题目:hdu3613: 题意:有26字母对应的价值,然后给出以个串,把它分成两段字串,如果字串是回文串,串的价值就是每个字符和,不是就为0.求最大价值. 博客 分析:拓展KMP的应用求回文字串. #i ...
 - mongo数组修改器—$push、$ne、$addtoset、$pop、$pull
			
这几个方法也很有意思 $push 像已有的数组末尾加入一个元素,要是元素不存在,就会创建一个新的元素,如果元素存在了,就会再添加一个一模一样的元素,会造成元素的重复,所以在使用的时候,要确保该元素不存 ...