ubuntu11.10 编译android4.0 错处

阅读更多
今天使用ubuntu11.10编译android4.0出现以下问题:
prebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/limits.h:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
In file included from external/zlib/gzguts.h:28,
                 from external/zlib/gzclose.c:6:
prebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/fcntl.h:1: error: stray '\1' in program
In file included from external/zlib/gzguts.h:56,
                 from external/zlib/gzclose.c:6:

经调查发现是由于c++编译器的问题,ICS 与ubuntu自带的g++ 4.6不兼容,需要降到g++4.4才行,
sudo apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib

sudo ln -snf /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so

$ cd /usr/bin
$ sudo ln -snf gcc-4.4 gcc
$ sudo ln -snf g++-4.4 g++
$ sudo ln -snf cpp-4.4 cpp

你可能感兴趣的:(ubuntu11.10 编译android4.0 错处)