ubuntu12.04默认gcc4.6.3,如何升级到gcc4.8
之前所有在12.04上面的工作 對于gcc版本沒有特殊要求,最近ORBSLAM2要求支持C++11.
今天安裝SDL明確要求GCC4.8以上版本,否則出現錯誤。
這里記錄升級方法:? http://blog.csdn.net/linsanhua/article/details/38047559
?
1.) Press?Ctrl+Alt+T?on your keyboard to open terminal. When it opens, run below commands to add the ppa:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test2.) Then install gcc 4.8 and g++ 4.8:
sudo apt-get update; sudo apt-get install gcc-4.8 g++-4.83.) Once installed, run following commands one by one to use gcc 4.8 instead of previous version.
sudo update-alternatives --remove-all gcc sudo update-alternatives --remove-all g++sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20sudo update-alternatives --config gccsudo update-alternatives --config g++Now you have the?gcc 4.8 with c++11 complete feature?in your system. Check out by:
gcc --versiongcc (Ubuntu 4.8.1-2ubuntu1~13.04) 4.8.1
Copyright (C) 2013 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.
http://ubuntuhandbook.org/index.php/2013/08/install-gcc-4-8-via-ppa-in-ubuntu-12-04-13-04/
總結
以上是生活随笔為你收集整理的ubuntu12.04默认gcc4.6.3,如何升级到gcc4.8的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: update-alternatives使
- 下一篇: RDA8955烧写程序摘要