之前所有在12.04上面的工作 对于gcc版本没有特殊要求,最近ORBSLAM2要求支持C++11.
今天安装SDL明确要求GCC4.8以上版本,否则出现错误。
这里记录升级方法: http://blog.youkuaiyun.com/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/test
2.) Then install gcc 4.8 and g++ 4.8:
sudo apt-get update; sudo apt-get install gcc-4.8 g++-4.8
3.) 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 20 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20 sudo update-alternatives --config gcc sudo update-alternatives --config g++
Now you have the gcc 4.8 with c++11 complete feature in your system. Check out by:
gcc --version
http://ubuntuhandbook.org/index.php/2013/08/install-gcc-4-8-via-ppa-in-ubuntu-12-04-13-04/gcc (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.
为满足ORBSLAM2和SDL的GCC4.8以上版本要求,记录在Ubuntu 12.04上升级GCC4.8的步骤:添加PPA源,安装gcc 4.8和g++ 4.8,然后设置使用新版本。升级后,系统具备了GCC4.8和C++11完整功能。
9811

被折叠的 条评论
为什么被折叠?



