玩转BeagleBoard xM——TI_Android_ICS_4.0.3_DevKit编译错误及解决办法汇总

在Ubuntu 12.04上编译TI_Android_ICS_4.0.3_DevKit时,遇到各种编译或链接错误,现将各种错误情况以及解决办法汇总如下:

 

(1)错误1

<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>: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
解决方法:
修改源码目录下/build/core/combo/HOST_linux-x86.mk文件:
将以下语句
HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
修改为
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0)

 

(2)错误2

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;

 

(3)错误3

external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member ‘stat::st_ino’ [-Wmissing-field-initializers]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libgtest_host_intermediates/gtest-all.o] Error 1

解决方法:

external/gtest/include/gtest/internal/gtest-param-util.h

增加
#include <cstddef>

 

(4)错误4

frameworks/compile/slang/slang_rs_export_foreach.cpp:247:23: error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]cc1plus: all warnings being treated as errors

make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_export_foreach.o]

解决方法:

修改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

 

(5)错误5

/home/aa/project/android4.0.1/external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader] Error 1
make: *** Waiting for unfinished jobs....
解决方法:
修改external/llvm/llvm-host-build.mk文件

添加一行:

LOCAL_LDLIBS := -lpthread -ldl

 
(6)错误6

make: *** [out/target/common/obj/APPS/CtsVerifier_intermediates/classes-full-debug.jar] Error 41

make: Leaving directory `/media/zhaodezhong/study/ics_source'

原因分析:原因不详,忘高人指教。。。

解决办法:在网上查了些资料,知道CTS全称Compatibility Test Suite兼容性测试工具。当电子产品开发出来,并定制了自己

Android系统后,必须要通过最新的CTS检测,以保证标准的android application能运行在该平台下。通过了CTS验证,需要将

测试报告提交给Google,已取得android market的认证。感觉对android自身运行关系不大,所以干脆不编译这块内容了。

找到cts/下的Android.mk文件,注释掉里面两行代码

#include cts/CtsTestCoverage.mk

#include $(call all-subdir-makefiles)

(7)错误7

"bison" command not found

"gperf" command not found

"mkimage" command not found

等等,诸如command not found类错误

解决办法:

通过apt-get install安装相应的包,如:

apt-get install bison

apt-get install gperf

apt-get install uboot-mkimage

 

(8)错误8

make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/noproguard.classes-with-local.dex] Killed
解决办法:
这些错误都是 linux的OOM killer 导致,加大分配给虚拟机的内存,保险起见,把make的-j<N>参数改小一些,减少内存开销。

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值