error: "_FORTIFY_SOURCE" redefined [-Werror]

error: "_FORTIFY_SOURCE" redefined [-Werror]

 
host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp

:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
make: *** [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

 

 

转自:http://www.cnblogs.com/lotus_shelly/archive/2012/01/07/2316035.html

你可能感兴趣的:(error: "_FORTIFY_SOURCE" redefined [-Werror])