1. /usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
解决方法:sudo apt-get install gcc-multilib
2. /usr/bin/ld: cannot find -lstdc++
解决方法:sudo apt-get install g++-multilib
3. frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1
解决方法:
vim frameworks/base/libs/utils/Android.mk
增加红颜色的部分:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
4. /usr/bin/ld: cannot find -lz
解决方法:sudo apt-get install lib32z1-dev
5. /usr/bin/ld: cannot find -lncurses
解决方法:
ubuntu 12.04 64bit下命令如下
sudo apt-get install libncurses5-dev:i386
6、/bin/bash: cc: command not found
解决方法:sudo apt-get install gcc
7、/bin/bash: g++: command not found
解决方法:sudo apt-get install g++
8、<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
修改源码目录下build/core/combo/HOST_linux-x86.mk文件:
将以下语句
HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
修改为
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0