ubuntu12.04.4(x64)编译android-4.0.1_r1代码错误解决

1、/usr/bin/ld.bfd.real: cannot find -lGL


查看了一些资料,因为编译的时候还是用到了32BIT的libGL.so libX11.so库文件,编译的时候找的不是X86_64库文件配置,而是找的是I386库文件配置

$ sudo apt-get installibgl1-mesa-glx:i386(libGL.so)

由于libGL.so系统默认没有进行库路径下的链接,还需要手动链接一下

$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so


2、external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
解决办法:
vim external/llvm/llvm-host-build.mk
LOCAL_LDLIBS := -lpthread -ldl


3、gtest错误

  1. external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name type  
解决:

external/gtest里打patch或者自己手动修改

  1. diff --git a/include/gtest/internal/gtest-param-util.h b/include/gtest/internal/gtest-param-util.h  
  2. index 5559ab4..b964c45 100644  
  3. --- a/include/gtest/internal/gtest-param-util.h  
  4. +++ b/include/gtest/internal/gtest-param-util.h  
  5. @@ -37,6 +37,7 @@  
  6.  #include <iterator>  
  7.  #include <utility>  
  8.  #include <vector>  
  9. +#include <cstddef>   
  10.    
  11.  #include <gtest/internal/gtest-port.h> 

4、mutable错误

  1. external/oprofile/libpp/format_output.h:94:22: error: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]  

解决方法:

external/oprofile里打patch或者自己手动修改文件

  1. diff --git a/libpp/format_output.h b/libpp/format_output.h  
  2. index b6c4592..4efdbb1 100644  
  3. --- a/libpp/format_output.h  
  4. +++ b/libpp/format_output.h  
  5. @@ -91,7 +91,8 @@ protected:  
  6.                 symbol_entry const symbol;  
  7.                 sample_entry const sample;  
  8.                 size_t pclass;  
  9.               mutable counts_t counts;  
  10. +//             mutable counts_t counts;  
  11.               counts_t counts;  
  12.                 extra_images const extra;  
  13.                 double diff;  
  14.         }; 

5、<命令行>:0:0: 错误: “_FORTIFY_SOURCE”重定义 [-Werror]

修改build/core/combo/HOST_linux-x86.mk 61行,将
HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
修改成
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
Android源码换服务器了,具体的看http://source.android.com/source/downloading.html


6、 error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable]

遇到这个错误

host C++: llvm-rs-cc <= frameworks/compile/slang/slang_rs_export_foreach.cpp
frameworks/compile/slang/slang_rs_export_foreach.cpp: In static member function ‘static slang::RSExportForEach* slang::RSExportForEach::Create(slang::RSContext*, const clang::FunctionDecl*)’:
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
解决办法有两个   

     1.注释掉frameworks/compile/slang/slang_rs_export_foreach.cpp 中的247行的 定义ParamName的语句;

     2..在工程根目录下,打开下面的makefile文件:
          # vi frameworks/compile/slang/Android.mk 

         在打开的makefile文件中按照下面更改:
         -----local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
        ++++local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter


http://blog.csdn.net/yuan1590/article/details/7530735

http://blog.csdn.net/shuzui1985/article/details/7628121

http://hcleon.iteye.com/blog/1461352

http://blog.csdn.net/zlm_250/article/details/7949440

http://blog.csdn.net/conanyang/article/details/751874

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值