Ubuntu 安裝GCC4.8

正好是我需要的,轉載之。

轉載地址:

http://cpp1x.org/Install-GCC4.8-Ubuntu.html (這個最好)

http://blog.csdn.net/csfreebird/article/details/7627985

http://maykiller.com/2012/ubuntu-install-gcc-4-7-with-set-default/


安裝

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.8
sudo apt-get install g++-4.8

將 4.8 設爲默認 GCC 版本

sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
sudo rm /usr/bin/g++
sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++
在編譯的時候添加”-std=c++11″不帶引號即可正常編譯C++11標準的代碼!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章