海绵宝宝的欧尼 2013-04-08
今天使用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
Infileincludedfromexternal/zlib/gzguts.h:28,
fromexternal/zlib/gzclose.c:6:
prebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/fcntl.h:1:error:stray'\1'inprogram
Infileincludedfromexternal/zlib/gzguts.h:56,
fromexternal/zlib/gzclose.c:6:
经调查发现是由于c++编译器的问题,ICS与ubuntu自带的g++4.6不兼容,需要降到g++4.4才行,
sudoapt-getinstallgcc-4.4g++-4.4g++-4.4-multilibgcc-4.4-multilib
sudoln-snf/usr/lib/i386-linux-gnu/libX11.so.6/usr/lib/i386-linux-gnu/libX11.so
$cd/usr/bin
$sudoln-snfgcc-4.4gcc
$sudoln-snfg++-4.4g++
$sudoln-snfcpp-4.4cpp