ubuntu 选择gcc 版本
来源:互联网 发布:win10下载哪个java jdk 编辑:程序博客网 时间:2024/05/29 21:16
http://stackoverflow.com/questions/7832892/how-to-change-the-default-gcc-compiler-in-ubuntu
To figure out the current priorities of gcc, type in the command pointed out by @tripleee's comment:
查看当前的可切换的版本: update-alternatives --query gcc
例如有 4.6 4.5 两个版本
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 100update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.5 50update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 100update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.5 50update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 100update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.5 50
设置为4.5
update-alternatives --set g++ /usr/bin/g++-4.5update-alternatives --set gcc /usr/bin/gcc-4.5update-alternatives --set cpp-bin /usr/bin/cpp-4.5Here, 4.6 is still the default (aka "auto mode"), but I explicitly switch to 4.5 temporarily (manual mode). To go back to 4.6:
方法二:update-alternatives --auto g++update-alternatives --auto gccupdate-alternatives --auto cpp-bin
echo 'export CXX=/usr/bin/gcc-4.5' >> ~/.bashrc
移除当前的选择可以这样
First erased the current update-alternatives setup for gcc and g++:
sudo update-alternatives --remove-all gcc sudo update-alternatives --remove-all g++
Install PackagesIt seems that both gcc-4.3 and gcc-4.4 are installed after install build-essential. However, we can explicitly install the following packages:
sudo apt-get install gcc-4.3 gcc-4.4 g++-4.3 g++-4.4
First erased the current update-alternatives setup for gcc and g++:
sudo update-alternatives --remove-all gcc sudo update-alternatives --remove-all g++
Install Packages
It seems that both gcc-4.3 and gcc-4.4 are installed after install build-essential. However, we can explicitly install the following packages:
sudo apt-get install gcc-4.3 gcc-4.4 g++-4.3 g++-4.4
- ubuntu 选择gcc 版本
- gcc版本切换 ubuntu
- Ubuntu gcc切换版本
- Ubuntu修改gcc版本
- Ubuntu-gcc版本切换
- Ubuntu升级gcc版本
- ubuntu修改gcc版本
- Ubuntu升级GCC版本
- Ubuntu升级GCC版本
- Ubuntu选择python版本
- Ubuntu 安装低版本 GCC
- Ubuntu 安装低版本 GCC
- ubuntu下gcc版本切换
- Ubuntu安装低版本gcc
- Ubuntu安装低版本gcc
- ubuntu下多个gcc版本切换
- ubuntu下降低gcc版本
- Ubuntu Android GCC 版本配置
- 递归的函数
- 跨平台的HTML转图片方法
- 陶陶摘苹果
- cordova 环境搭建
- opencv图像旋转
- ubuntu 选择gcc 版本
- Sublime Text 3 全程详细图文原创教程(持续更新中。。。)
- Sublime Text:添加格式化代码快捷键
- Git获取某个分支的特定文件夹或者文件
- java POI实现Excel单元格数据换行
- (6)Kurento之系统搭建IV-Helloworld
- Apache VirtualHost配置
- Codeforces Round #390 (Div. 2//754D. Fedor and coupons
- CentOS下设置nginx开机自动启动和chkconfig管理