非常好的下载android codes地址: http://d.zhu.im/Android/
抓下来所有的codes,设置环境变量,开始make...
1.prebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/sys/types.h:1: error: expected identifier or '(' before '!' token
prebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/sys/types.h:1: error: stray '\377' in program
prebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/include/sys/types.h:1: error: stray '\376' in program
等等之类的错误。
解决方案:
发现types.h文件的内容是:
!<symlink>? . / . . / . . / . . / . . / . . / p l a t f o r m s / a n d r o i d - 8 / a r c h - a r m / u s r / i n c l u d e / s y s / t y p e s . h
这里应该的意思是用a n d r o i d - 8下面header file,同样打开a n d r o i d - 8下面的文件,发现类似,所以继续找,在a n d r o i d - 3中,终于找到“真身”。
不清楚!<symlink>?是什么东西,干脆类似文件,全部用a n d r o i d - 3下面的覆盖过来。
遇到一个类似问题:
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: error: prebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/lib/libstdc++.so:1:1: syntax error, unexpected '!', expecting $end
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: error: prebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/lib/libstdc++.so: not an object or archive
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: error: prebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/lib/libm.so:1:1: syntax error, unexpected '!', expecting $end
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: error: prebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/lib/libm.so: not an object or archive
collect2: ld returned 1 exit status
解决办法:prebuilt/ndk/android-ndk-r5/platforms/android-9/arch-arm/usr/lib/libstdc++.so文件不正确,只是prebuilt/ndk/android-ndk-r5/platforms/android-3/arch-arm/usr/lib/libstdc++.so的ln。没有实际内容:应该也是在文件中出现了!<symlink>?