More than 1 year has passed since last update.
# cd /etc/yum.repos.d
# wget
# yum -y --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++
# /opt/centos/devtoolset-1.1/root/usr/bin/g++ --version
g++ (GCC) 4.7.2 20121015 (Red Hat 4.7.2-5)

# vi /etc/profile
export CC=/opt/centos/devtoolset-1.1/root/usr/bin/gcc
export CXX=/opt/centos/devtoolset-1.1/root/usr/bin/g++
export PATH=/opt/centos/devtoolset-1.1/root/usr/bin:$PATH

$ g++ --version
g++ (GCC) 4.7.2 20121015 (Red Hat 4.7.2-5)
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.