android4.0源码编译过程中中各种错误解决,android源码编译错误

本文主要介绍了Android 4.0源码编译过程中出现的各种错误及解决办法。如在特定文件中增加头文件声明、修改编译参数,安装缺失的库文件,降低gcc版本级别等,为Android源码编译遇到问题的开发者提供了解决思路。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

make: *** [out/host/linux-x86/obj/EXECUTABLES/emugen_intermediates/main.o] error 1解决办法: 需要在 development/tools/emulator/opengl/host/tools/emugen/main.cpp

在声明中增加一条头文件声明 #include

make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/AaptAssets.o] error 1解决办法: frameworks/base/tools/aapt/Android.mk 在第31行增加: LOCAL_CFLAGS += -Wno-format-y2k -fpermissive

make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/AssetManager.o] error 1解决办法:在 frameworks/base/libs/utils/Android.mk 在第60行后面增加-fpermissive: LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive

make: ** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] error 1 /usr/bin/ld: cannot find -lz collect2: error: ld returned 1 exit status make: ** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] error 1解决方法: sudo apt-get install lib32z1-dev

make: *** [out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/grxmlcompile.o] Error 1解决办法:cd external/srec 复制拷贝下面的命令到终端: wget “https://github.com/CyanogenMod/android_external_srec/commit/4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff” patch -p1 < 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff rm -f 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff cd ../..

make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libdvm_intermediates/native/dalvik_system_Zygote.o] Error 1解决方法 add #include to dalvik/vm/native/dalvik_system_Zygote.cpp

make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libOpenglCodecCommon_intermediates/GLSharedGroup.o] Error 1解决办法: $vim development/tools/emulator/opengl/Android.mk Add ‘-fpermissive’ to line 25: EMUGL_COMMON_CFLAGS := -DWITH_GLES2 -fpermissive

make: *** [out/host/linux-x86/obj/lib/libOpenglRender.so] Error 1 :0:0: note: this is the location of the previous definition host StaticLib: libOpenglCodecCommon (out/host/linux-x86/obj/STATIC_LIBRARIES/libOpenglCodecCommon_intermediates/libOpenglCodecCommon.a) host SharedLib: libOpenglRender (out/host/linux-x86/obj/lib/libOpenglRender.so) /usr/bin/ld: cannot find -lX11 collect2: error: ld returned 1 exit status make: *** [out/host/linux-x86/obj/lib/libOpenglRender.so] Error 1解决方法: sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so

make: ** [out/host/linux-x86/obj/EXECUTABLES/emulator_renderer_intermediates/emulator_renderer] Error 1 /usr/bin/ld: out/host/linux-x86/obj/EXECUTABLES/emulator_renderer_intermediates/main.o: undefined reference to symbol ‘XInitThreads’ //usr/lib/i386-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make: ** [out/host/linux-x86/obj/EXECUTABLES/emulator_renderer_intermediates/emulator_renderer] Error 1解决办法: vi development/tools/emulator/opengl/host/renderer/Android.mk Add new entry ‘LOCAL_LDLIBS += -lX11’ after line 6 as shown: LOCAL_SRC_FILES := main.cpp LOCAL_CFLAGS += -O0 -g LOCAL_LDLIBS += -lX11 #ifeq ($(HOST_OS),windows) #LOCAL_LDLIBS += -lws2_32

/usr/include/zlib.h:34:19: fatal error: zconf.h: No such file or directory /usr/include/zlib.h:34:19: fatal error: zconf.h: No such file or directory #include “zconf.h”解决办法: sudo ln -s /usr/include/x86_64-linux-gnu/zconf.h /usr/include

make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] error 1解决办法: 是由于版本太高,在配置环境的时候,gcc安装了高版本,所以gcc版本太高导致,需要降低gcc版本级别。 ubuntu 32bit系统下安装gcc 4.4的最好方法是仅用以下两条命令,不需要其它命令,否则编译时可能会出错。 sudo apt-get install gcc-4.4 sudo apt-get install g++-4.4 操作过程见: gcc降级: sudo rm -rf /usr/bin/gcc sudo ln -s /usr/bin/gcc-4.4 /usr/bin/gcc gcc -v g++降级 sudo rm -rf /usr/bin/g++ sudo ln -s /usr/bin/g++-4.4 /usr/bin/g++ g++ -v

g++: selected multilib ‘32’ not installed host Executable: obbtool (out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/obbtool) g++: selected multilib ‘32’ not installed make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/obbtool] Error 1解决办法: sudo apt-get install g++-4.4-multilib

make: ** [out/host/linux-x86/obj/lib/libGLES_CM_translator.so] Error 1 /usr/bin/ld: cannot find -lGL collect2: ld returned 1 exit status make: ** [out/host/linux-x86/obj/lib/libGLES_CM_translator.so] Error 1解决办法: sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2 /usr/lib/libGL.so

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值