歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

Ubuntu 12.04編譯android-4.0.1_r1錯誤總結

Ubuntu 64位編譯 Android 4.0源碼

以下錯誤是具體碰到,也有些是沒有碰到,網上查到的資料拷貝的備份;

===== 錯誤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
參考:http://code.google.com/p/android/issues/detail?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
參考:http://code.google.com/p/android/issues/detail?id=22006#c0
參考:http://groups.google.com/group/android-building/browse_thread/thread/0207abb98ed72304

===== 錯誤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

Copyright © Linux教程網 All Rights Reserved