背景:
阅读新闻
Ubuntu 12.04编译android-4.0.1_r1错误总结
[日期:2012-09-11] 来源:Linux社区 作者:houyizi [字体:]
以下错误是具体碰到,也有些是没有碰到,网上查到的资料拷贝的备份;
===== 错误1 =====
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
===== 错误2 =====
解决办法: 
build/core/combo/HOST_linux-x86.mk line 61: 
把: 
HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0 
改为: 
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 
参考:?id=20795 
===== 错误3 =====
development/tools/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp:22:20: fatal error: GL/glx.h: No such file or directory 
compilation terminated. 
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libGLcommon_intermediates/GLDispatch.o] Error 1 
解决办法: 
sudo apt-get install libgl1-mesa-dev 
===== 错误4 ===== 
frameworks/compile/slang/slang_rs_export_foreach.cpp:247:23: error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable] 
解决办法: 
vim frameworks/compile/slang/Android.mk 
把: 
local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror 
改为: 
local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter 
参考:?id=22006#c0 
参考: 
===== 错误5 ===== 
In file included from external/oprofile/libpp/arrange_profiles.cpp:24:0: 
external/oprofile/libpp/format_output.h:94:22: error: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive] 
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/arrange_profiles.o] Error 1 
解决办法: 
external/oprofile/libpp/format_output.h 
把: 
mutable counts_t & counts; 
改为: 
counts_t & counts; 
===== 错误6 ===== 
external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock' 
collect2: ld returned 1 exit status 
解决办法: 
vim external/llvm/llvm-host-build.mk 
LOCAL_LDLIBS := -lpthread -ldl 
采用以下解决办法没有成功 
vi external/llvm/lib/Support/Android.mk 
添加 
LOCAL_C_INCLUDES += system/core/include/cutils 
LOCAL_SHARED_LIBRARIES := libcutil 
(其中存在两个模块,两个都加上上面两句话吧) 
以及在Mutex.cpp文件中加上threads.h头文件的引入 
vi external/llvm/lib/Support/Mutex.cpp 
添加 
#include 
以及在Threading.cpp文件中加上threads.h头文件的引入 
vi external/llvm/lib/Support/Threading.cpp 
添加 
#include 
===== 错误7 ===== 
external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type 
解决办法: 
vim external/gtest/src/../include/gtest/internal/gtest-param-util.h 
#include 
不使用man 3 printf的函数,实现一个简单的printf函数
相关资讯 Android开发入门
		       
	
本文评论 查看全部评论 (0)
 尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯
