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

2023-12-13 14:08

本文主要是介绍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

这篇关于ubuntu12.04.4(x64)编译android-4.0.1_r1代码错误解决的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/488741

相关文章

Spring事务中@Transactional注解不生效的原因分析与解决

《Spring事务中@Transactional注解不生效的原因分析与解决》在Spring框架中,@Transactional注解是管理数据库事务的核心方式,本文将深入分析事务自调用的底层原理,解释为... 目录1. 引言2. 事务自调用问题重现2.1 示例代码2.2 问题现象3. 为什么事务自调用会失效3

SpringBoot实现MD5加盐算法的示例代码

《SpringBoot实现MD5加盐算法的示例代码》加盐算法是一种用于增强密码安全性的技术,本文主要介绍了SpringBoot实现MD5加盐算法的示例代码,文中通过示例代码介绍的非常详细,对大家的学习... 目录一、什么是加盐算法二、如何实现加盐算法2.1 加盐算法代码实现2.2 注册页面中进行密码加盐2.

mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)的解决方法

《mysql出现ERROR2003(HY000):Can‘tconnecttoMySQLserveron‘localhost‘(10061)的解决方法》本文主要介绍了mysql出现... 目录前言:第一步:第二步:第三步:总结:前言:当你想通过命令窗口想打开mysql时候发现提http://www.cpp

python+opencv处理颜色之将目标颜色转换实例代码

《python+opencv处理颜色之将目标颜色转换实例代码》OpenCV是一个的跨平台计算机视觉库,可以运行在Linux、Windows和MacOS操作系统上,:本文主要介绍python+ope... 目录下面是代码+ 效果 + 解释转HSV: 关于颜色总是要转HSV的掩膜再标注总结 目标:将红色的部分滤

SpringBoot启动报错的11个高频问题排查与解决终极指南

《SpringBoot启动报错的11个高频问题排查与解决终极指南》这篇文章主要为大家详细介绍了SpringBoot启动报错的11个高频问题的排查与解决,文中的示例代码讲解详细,感兴趣的小伙伴可以了解一... 目录1. 依赖冲突:NoSuchMethodError 的终极解法2. Bean注入失败:No qu

在C#中调用Python代码的两种实现方式

《在C#中调用Python代码的两种实现方式》:本文主要介绍在C#中调用Python代码的两种实现方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录C#调用python代码的方式1. 使用 Python.NET2. 使用外部进程调用 Python 脚本总结C#调

springboot报错Invalid bound statement (not found)的解决

《springboot报错Invalidboundstatement(notfound)的解决》本文主要介绍了springboot报错Invalidboundstatement(not... 目录一. 问题描述二.解决问题三. 添加配置项 四.其他的解决方案4.1 Mapper 接口与 XML 文件不匹配

Android Kotlin 高阶函数详解及其在协程中的应用小结

《AndroidKotlin高阶函数详解及其在协程中的应用小结》高阶函数是Kotlin中的一个重要特性,它能够将函数作为一等公民(First-ClassCitizen),使得代码更加简洁、灵活和可... 目录1. 引言2. 什么是高阶函数?3. 高阶函数的基础用法3.1 传递函数作为参数3.2 Lambda

Java时间轮调度算法的代码实现

《Java时间轮调度算法的代码实现》时间轮是一种高效的定时调度算法,主要用于管理延时任务或周期性任务,它通过一个环形数组(时间轮)和指针来实现,将大量定时任务分摊到固定的时间槽中,极大地降低了时间复杂... 目录1、简述2、时间轮的原理3. 时间轮的实现步骤3.1 定义时间槽3.2 定义时间轮3.3 使用时

Python中ModuleNotFoundError: No module named ‘timm’的错误解决

《Python中ModuleNotFoundError:Nomodulenamed‘timm’的错误解决》本文主要介绍了Python中ModuleNotFoundError:Nomodulen... 目录一、引言二、错误原因分析三、解决办法1.安装timm模块2. 检查python环境3. 解决安装路径问题