Ubuntu 11.10编译Android 4.0.1源码错误


刚把Android 4.0.1下载到自己的Ubuntu 11.10(64位)系统里,把整个编译环境都配置好了(参考 http://www.bkjia.net/thread-2736-1-1.html ),编译时还是出现了如下的错误提示:

<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]

<built-in>:0:0: note: this is the location of the previous definition cc1plus: all warnings being treated as errors

make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] Error 1

后来发现了,原来是Ubuntu11.10里的gcc和g++版本太高了,于是执行下面的操作:

sudo apt-get install gcc-4.4

sudo apt-get install g++-4.4

sudo rm -rf /usr/bin/gcc /usr/bin/g++

sudo ln -s /usr/bin/gcc-4.4 /usr/bin/gcc

sudo ln -s /usr/bin/g++-4.4 /usr/bin/g++

把默认的4.6版本换为了4.4,继续编译源码,又出现了另一个错误,大致提示为:

g++ selected multilib '32' not installed

继续奋战吧,安装相应的工具吧:sudo apt-get install g++-4.4-multilib,现在正在make -j8在我的i5/4G机子里跑着。

相关内容