博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu 12.04 安装设置gcc4.4
阅读量:6251 次
发布时间:2019-06-22

本文共 2173 字,大约阅读时间需要 7 分钟。

在Ubuntu 12.04中的默认的GCC版本是4.6。但是这个版本在编译android 4.0源码的时候会出差,下面是安装和设置GCC4.4的方法。

下文来自网络:

I’ve been having some problems with Ubuntu 11.10′s default GCC (4.6.2) for some time now. First, I was having problems with self-kang CyanogenMod 9 builds on my Samsung Tab 7 Plus (specifically, adb wouldn’t work). Second, I couldn’t boot Linux kernel 3.3 on my .

I didn’t know the problems were because of GCC until recently, but now that I’ve switched back to 4.4 both of those problems have gone away; I can only assume that something in Ubuntu’s GCC fork is broken. The solution: set GCC 4.4 as the default compiler.

It’s pretty easy to do this in Debian-based distros using the alternatives system.

Install GCC 4.4

First, install GCC 4.4 (and friends):

apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib

Set 4.4 to be the default

Then set 4.4 to be higher priority than 4.6:

update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 100update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 50update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 100update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 50update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4 100update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 50

Verify that it has worked:

gcc -vUsing built-in specs.Target: x86_64-linux-gnuConfigured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.6-11ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnuThread model: posixgcc version 4.4.6 (Ubuntu/Linaro 4.4.6-11ubuntu2)

Done!

转载于:https://www.cnblogs.com/tnxk/archive/2012/07/07/2580731.html

你可能感兴趣的文章
pt-heartbeat工具监控MySQL复制延迟
查看>>
指尖下的js —— 多触式web前端开发之三:处理复杂手势(转)
查看>>
spring boot项目配置文件集合
查看>>
cube-ui的用法
查看>>
2015.4.21 SetWindowPos函数用法
查看>>
2011-12-14 调用cmd并获得输入输出+网络访问
查看>>
TCP定时器详解
查看>>
if判断,switch语句
查看>>
Arduino入门之前
查看>>
zoj 1904 Beavergnaw 计算圆柱和圆台的体积
查看>>
整理了一份招PHP高级工程师的面试题(转)
查看>>
学习Raft算法的笔记
查看>>
第十一周编程总结
查看>>
darknet源码学习
查看>>
dl,dt,dd的用法
查看>>
外面的世界很精彩,然而等待你的人却可能已不在
查看>>
华为oj 挑7
查看>>
【吴恩达机器学习】学习笔记——1.5无监督学习
查看>>
使用pjax实现类似github无刷新更改页面url
查看>>
移动端头部meta
查看>>