android,编译过程遇到的错误

来源:互联网 发布:三星集团的成功 知乎 编辑:程序博客网 时间:2024/05/21 09:44
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror] <built-in>:0:0: note: this is the location of the previous definition cc1plus: all warnings being treated as errorsmake: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] Error 1

问题原因:由于ubuntu 11.10采用了GCC4.6.1导致的。

解决方法:修改源码目录下/build/core/combo/HOST_linux-x86.mk文件

将HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0改为HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

======================================================================================================================================

frameworks/base/libs/utils/RefBase.cpp:507:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]make: *** [release/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1

解决方法:修改源码目录下frameworks/base/libs/utils/Android.mk文件

将LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 ¥(TOOL_CFLAGS)改为LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 ¥(TOOL_CFLAGS) –fpermissive





原创粉丝点击