注:android应使用Java6与gcc 4.4
摘自:http://blog.chinaunix.net/uid-24448954-id-3206913.html
摘录:
错误处理
在Ubuntu10.10(64位)编译Android2.3源码时,遇到各种各样的问题。不是缺这个,就是少那个。现把这些问题和解决方法罗列出来,供
大家参考。
错误:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file
or directory
make: ***
[out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] 错误
1
解决:
sudo apt-get install libc6-dev-i386
错误:
make: ***
[out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp] error
1
解决:
sudo apt-get install g++-multilib
错误:
external/clearsilver/cgi/cgi.c:22: fatal error: zlib.h: No such
file or directory
compilation terminated.
make: ***
[out/host/linux-x86/obj/SHARED_LIBRARIES/libneo_cgi_intermediates/cgi.o]
Error 1
解决:
sudo apt-get install zlib1g-dev
错误:
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: ***
[out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error
1
解决:
sudo apt-get install lib32z1-dev
错误:
bison -d -o
out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp
frameworks/base/tools/aidl/aidl_language_y.y
/bin/bash: bison: command not found
make: ***
[out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp]
Error 127
解决:
sudo apt-get install bison
错误:
Lex: aidl <=
frameworks/base/tools/aidl/aidl_language_l.l
/bin/bash: flex: command not found
make: ***
[out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp]
Error 127
解决:
sudo apt-get install flex
错误:
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: ***
[out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error
1
解决:
sudo apt-get install lib32ncurses5-dev
错误:
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:55: fatal error:
X11/Xlib.h: No such file or directory
compilation terminated.
make: ***
[out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/android/main-common.o]
Error 1
解决:
sudo apt-get install libx11-dev
错误:
sh: gperf: not found
calling gperf failed: 32512 at ./makeprop.pl line 96.
make: ***
[out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h]
Error 25
make: *** Deleting file
`out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h'
解决:
sudo apt-get install gperf
错误:
build/core/java.mk:9: *** bin: Target java module does not define
any source or resource files. Stop.
解决:
删
除源码根目录下的bin文件夹,这个文件夹是导入eclipse时创建的。
cannot find -lXXX
所有编译过程中遇到的类似这样的错误,都是缺少libXXX这样的库,解决方法就是:
首先: 利用命令:apt-cache search XXX 进行库搜索
然后:找那些libXXX-dev这样的库进行安装,命令就是:sudo
apt-get install libXXX-dev
最后:继续执行make
摘自:http://blog.csdn.net/caimouse/article/details/7107080
external/mesa3d/src/glsl/linker.cpp:1734:50: error: ‘fragColor’ was not declared in this scope external/mesa3d/src/glsl/linker.cpp:1734:59: error: ‘offsetof’ was not declared in this scope make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1
解决这个问题需要修改文件如下:
把 "#include " 添 到 linker.cpp 文件头部。
这 就可以编译完成了。
摘自:http://hi.baidu.com/hyemiletoe/item/0403f331f12017179cc65ed9In file included from external/oprofile/libpp/arrange_profiles.cpp:24:0:
external/oprofile/libpp/format_output.h:94:22: 错误: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]
解决办法: external/oprofile/libpp/format_output.h 把: mutable counts_t & counts; 改为: counts_t & counts;
摘自:http://blog.csdn.net/zhbpd/article/details/7680835
external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type
make[2]: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libgtest_main_host_intermediates/gtest_main.o] Error 1
解决办法:
$vim
external/gtest/src/../include/gtest/internal/gtest-param-util.h
添加:
#include
摘自:http://blog.sina.com.cn/s/blog_ab85e99501018r6x.html
一些错误需要使用gcc4.4来避免
摘自:http://www.blogjava.net/ZircoN/archive/2011/11/13/363452.html
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev x11proto-core-dev libx11-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils
转发至微博
转发至微博