ubuntu 11.10 编译android 4.0问题
来源:互联网 发布:matlab 字符数组 编辑:程序博客网 时间:2024/06/05 02:15
1、基础环境配置
修改 gedit frameworks/base/libs/utils/Android.mk
将:
改为:
错误日志1
修改make文件
frameworks/base/tools/aapt/Android.mk
frameworks/base/tools/localize/Android.mk
将这几句
sudo apt-get install ant ant-optional bison build-essential ca-certificates-java curl flex fusesmb g++-4.4-multilib g++-multilib gcc-4.4-multilib gcc-multilib git-core git-gui gitk gnuit gnupg gperf ia32-libs lib32ncurses5-dev libreadline-gplv2-dev lib32readline-gplv2-dev lib32z1 lib32z1-dev libc6-dev-i386 libesd0-dev libmotif4 libncurses5-dev libsasl2-modules-gssapi-mit libsdl1.2-dev libx11-dev meld menu tsocks valgrind vim x11proto-core-dev zip zlib1g-dev
2、编译错误
1)
错误日志1host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp
frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] 错误 1
错误日志2
In 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]
错误日志3
In file included from external/oprofile/pp/opreport.cpp:32:0: external/oprofile/libpp/format_output.h:94:22: 错误: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive] In file included from external/oprofile/libpp/xml_utils.h:15:0, from external/oprofile/pp/opreport_options.cpp:26: external/oprofile/libpp/format_output.h:94:22: 错误: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]
解决方法:修改 gedit frameworks/base/libs/utils/Android.mk
将:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
改为:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive
修改文件
external/oprofile/libpp/Android.mk
external/oprofile/pp/Android.mk
将
LOCAL_CFLAGS := $(common_host_cflags)
改为
LOCAL_CFLAGS := $(common_host_cflags) -fpermissive
或者修改build/core/combo/HOST_linux-x86.mk给HOST_GLOBAL_CFLAGS加上 -fpermissive
2)
链接错误错误日志1
system/core/libcutils/threads.c:27: undefined reference to ‘pthread_getspecific'
out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_set':
system/core/libcutils/threads.c:36: undefined reference to ’pthread_key_create'
system/core/libcutils/threads.c:44: undefined reference to ‘pthread_setspecific'
collect2: ld 返回 1
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] 错误 1
错误日志2
out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_get':
system/core/libcutils/threads.c:27: undefined reference to `pthread_getspecific'
out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_set':
system/core/libcutils/threads.c:36: undefined reference to `pthread_key_create'
system/core/libcutils/threads.c:44: undefined reference to `pthread_setspecific'
collect2: true
Generating libraries.cc
python out/host/linux-x86/obj/EXECUTABLES/mksnapshot_intermediates/js2c.py out/host/linux-x86/obj/EXECUTABLES/mksnapshot_intermediates/libraries.cc out/host/linux-x86/obj/EXECUTABLES/mksnapshot_intermediates/libraries-empty.cc CORE external/v8/src/runtime.js external/v8/src/v8natives.js external/v8/src/array.js external/v8/src/string.js external/v8/src/uri.js external/v8/src/math.js external/v8/src/messages.js external/v8/src/apinatives.js external/v8/src/date.js external/v8/src/regexp.js external/v8/src/json.js external/v8/src/mirror-debugger.js external/v8/src/debug-debugger.js external/v8/src/macros.py
ld 返回 1
make: *** [out/host/linux-x86/obj/EXECUTABLES/localize_intermediates/localize] 错误 1
make: *** 正在等待未完成的任务....
解决方法:修改make文件
frameworks/base/tools/aapt/Android.mk
frameworks/base/tools/localize/Android.mk
将这几句
ifeq ($(HOST_OS),linux)
LOCAL_LDLIBS += -lrt
endif
改为
ifeq ($(HOST_OS),linux)
LOCAL_LDLIBS += -lrt -lpthread
endif
3)
错误日志
<命令行>:0:0: 错误: “_FORTIFY_SOURCE”重定义 [-Werror]
解决方法
修改build/core/combo/HOST_linux-x86.mk将
HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0改为HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
- ubuntu 11.10 编译android 4.0问题
- ubuntu 11.10 编译 android 源码问题
- ubuntu 12.04 编译android 时问题总结
- ubuntu 编译android 源码时Openjdk 问题
- Ubuntu 11.10编译Android 错误
- Ubuntu 11.10编译Android 错误
- Ubuntu 11.10编译Android 错误
- Ubuntu 11.10编译Android 错误
- Ubuntu 11.10编译Android 错误
- Ubuntu 12.04 编译 android 4.0
- android 编译碰到的问题及解决办法:(ubuntu下编译)
- Ubuntu 11.10编译Android 4.0.1源码错误
- ubuntu 编译问题
- ubuntu编译问题总结
- Ubuntu 11.10 64bit系统编译android 2.3的相关问题
- Ubuntu 12.04 LTS server 编译 android-4.0.4_r2.1遇到的问题和解决方法
- Android Gingerbread基于32 bit Ubuntu 10.10编译问题
- Android Gingerbread基于32 bit Ubuntu 10.10编译问题
- 获得良好UI响应的三种方法
- CCNA学习篇之交换机
- 如何让tomcat告别频繁重启
- sonar 安装配置笔记
- JMF的下载地址
- ubuntu 11.10 编译android 4.0问题
- Discuz x2 分类信息教程
- 所谓修养~~
- Android原生(Native)C(JNI/NDK)开发之二:framebuffer篇
- sqlite3中的数据类型
- 绩效主义
- STL的multimap使用 一对多索引
- VMware host-only 配置
- UC故事 2012/04/08 review以前内容