打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Ubuntu11.04(64位)编译Android2.3源码常见错误解决办法

Ubuntu11.04(64位)编译Android2.3源码常见错误解决办法

今天在Ubuntu11.04(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
From:http://blog.csdn.net/offbye/article/details/6834285


1.解决各种依赖问题
首先安装一些库

123
sudo apt-get install gnupg flex bison gperf libsdl1.2-dev libesd0-dev sudo apt-get install libwxgtk2.6-dev squashfs-tools build-essential  sudo apt-get install zlib1g-dev pngcrush schedtool ia32-libs libncurses5-dev

这些库可能不全,如果出现问题,再google一下吧

2.error: “_FORTIFY_SOURCE” redefined [-Werror]
这个问题,据说与gcc版本有关,4.4版不会出现。
后来在google code 上找到了使用gcc 4.6编译的方法
修改build/core/combo/HOST_linux-x86.mk 文件 line 61

12
-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

这是CyanogenMod打上的补丁

3.No rule to make target ‘out/target/product/generic/obj/lib/libcamera.so’
修改 /home/Android-2.3.4/frameworks/base/services/camera/libcameraservice/Android.mk,USE_CAMERA_STUB:=false ->ture

123456789101112131415
LOCAL_PATH:= $(call my-dir) # Set USE_CAMERA_STUB if you don't want to use the hardware camera. # force these builds to use camera stub onlyifneq ($(filter sooner generic sim,$(TARGET_DEVICE)),)  USE_CAMERA_STUB:=trueendif #########CHANGE THIS LINE############USE_CAMERA_STUB:=true ifeq ($(USE_CAMERA_STUB),)  USE_CAMERA_STUB:=falseendif
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
搭建Android源码编译环境
ubuntu 下编译android源码错误解决记录
Android源码编译make的错误处理
Android系统编译过程中常见问题汇总(1)
ubuntu 12.04 x64编译 Android4.4遇到的问题
没有硬件,我们就玩模拟的——android4.0编译过程
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服