最近要往arm开发板上移植android系统,大大小小的问题遇到了太多太多,都是泪啊。本人初接触嵌入式开发,对问题的根源不是太了解,不过好在每解决一个问题,便记录一下。话不多说,正式罗列问题:

  1. host Executable: a3dconvert (out/host/linux-x86/obj/EXECUTABLES/a3dconvert_intermediates/a3dconvert)
  2. /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.5./libstdc++.so when searching for -lstdc++
  3. /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.5./libstdc++.a when searching for -lstdc++
  4. /usr/bin/ld: cannot find -lstdc++
  5. /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.5./libgcc_s.so when searching for -lgcc_s
  6. /usr/bin/ld: cannot find -lgcc_s
  7. /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.5./libgcc.a when searching for -lgcc
  8. /usr/bin/ld: cannot find -lgcc
  9. collect2: ld returned exit status
  10. make: *** [out/host/linux-x86/obj/EXECUTABLES/a3dconvert_intermediates/a3dconvert] Error
  1. 解决方法:
    缺少g++-multilib库,安装即可: apt-get install g++-multilib
    $ sudo apt-get install g++-multilib g++-4.5-multilib
  2.  
  1. g++: 错误: fpermissive:没有那个文件或目录
  2. make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] 错误
  1. 解决方法:
    sudo apt-get install g++-4.4-multilib
  2.  
  1. rameworks/base/libs/utils/RefBase.cpp: 在成员函数‘void android::RefBase::weakref_type::trackMe(bool, bool)’中:
  2. frameworks/base/libs/utils/RefBase.cpp::: 错误: 将‘const android::RefBase::weakref_impl’作为‘void android::RefBase::weakref_impl::trackMe(bool, bool)’的‘this’实参时丢弃了类型限定 [-fpermissive]
  3. make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] 错误
  1. 原因:
    Ubuntu 11.10gcc 4.6版本太高了,android编译需要gcc 4.4
    解决方法:
    更换gccg++版本4.64.4
    sudo apt-get install gcc-4.4
    sudo apt-get install g++-4.4
    sudo rm -rf /usr/bin/gcc /usr/bin/g++
    sudo ln -s /usr/bin/gcc-4.4 /usr/bin/gcc
    sudo ln -s /usr/bin/g++-4.4 /usr/bin/g++
  2.  
  1. /usr/bin/ld: cannot find -lz
  2. host Executable: aapt (out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt)
  3. /usr/bin/ld: cannot find -lz
  4. collect2: ld returned exit status
  5. make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error
  1. 解决方法:
    sudo apt-get install zlib1g-dev
    sudo apt-get install lib64z1-dev
  2.  
  1. /bin/bash: bison: command not found
  2. Yacc: aidl <= frameworks/base/tools/aidl/aidl_language_y.y
  3. bison -d -o out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
  4. /bin/bash: bison: command not found
  5. make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error
  1. 解决方法:
    sudo apt-get install bison
  2.  
  1. /bin/bash: flex: command not found
  2. out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp: In function int yyparse()’:
  3. out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp:: warning: deprecated conversion from string constant to char*’
  4. out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp:: warning: deprecated conversion from string constant to char*’
  5. Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
  6. /bin/bash: flex: command not found
  7. make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error
  1. 解决方法:
    sudo apt-get install flex
  2.  
  1. /usr/bin/ld: cannot find -lncurses
  2. host Executable: adb (out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb)
  3. /usr/bin/ld: cannot find -lncurses
  4. collect2: ld returned exit status
  5. make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error
  1. 解决方法:
    sudo apt-get install libncurses5-dev
  2.  
  1. fatal error: GL/glx.h: No such file or directory
  2. development/tools/emulator/opengl/host/libs/Translator/GLcommon/GLDispatch.cpp:: fatal error: GL/glx.h: No such file or directory
  3. compilation terminated.
  4. make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libGLcommon_intermediates/GLDispatch.o] Error
  1. 解决方法:
    sudo apt-get install libgl1-mesa-dev
  2.  
  1. sh: gperf: not found
  2. target Generated: libwebcore <= external/webkit/Source/JavaScriptCore/create_regex_tables
  3. Generating CSSPropertyNames.h <= CSSPropertyNames.in
  4. sh: gperf: not found
  5. calling gperf failed: at ./makeprop.pl line .
  6. make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/css/CSSPropertyNames.h] Error
  7. make: *** Deleting file `out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/css/CSSPropertyNames.h'
  1. 解决方法:
    sudo apt-get install gperf
  2.  
  1. host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp
  2. frameworks/base/libs/utils/RefBase.cpp: In member function void android::RefBase::weakref_type::trackMe(bool, bool)’:
  3. frameworks/base/libs/utils/RefBase.cpp::: error: passing const android::RefBase::weakref_impl as this argument of void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]
  4. make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] 错误
  1. 解决方法:
    gedit frameworks/base/libs/utils/Android.mk
    将语句:
    LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
    修改为:
    LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) fpermissive
  2.  
  1. out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_get':
  2. /home/leno/works/android_dev/bin/system/core/libcutils/threads.c:: undefined reference to `pthread_getspecific'
  3. out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_set':
  4. /home/leno/works/android_dev/bin/system/core/libcutils/threads.c:: undefined reference to `pthread_key_create'
  5. /home/leno/works/android_dev/bin/system/core/libcutils/threads.c:: undefined reference to `pthread_setspecific'
  6. collect2: ld returned exit status
  7. make: *** [out/host/linux-x86/obj/EXECUTABLES/localize_intermediates/localize] 错误
  1. 解决方法:
    修改./framework/base/tools/localize/Android.mk文件
    ifeq ($(HOST_OS),linux)
    #LOCAL_LDLIBS += -lrt       把这行注释掉,改为下面一行。
    LOCAL_LDLIBS += -lrt -lpthread
    endif

Android 源码编译及常见错误及解决方法的更多相关文章

  1. 源码编译apache报错的解决方法

    源码编译apache报错的解决方法   问题介绍 在源码编译安装httpd时,./configure执行无错误,到make时就报错,在网络上搜索了很多文章,很多方法如换apr-util的低版本并不能很 ...

  2. android 源码编译中的错误 解决

    1.编译种错误提示: arm-none-linux-gnueabi-gcc: directory: No such file or directory arm-none-linux-gnueabi-g ...

  3. 【转】Android 源码编译make的错误处理--不错

    原文网址:http://blog.csdn.net/ithomer/article/details/6977386 Android源码下载:官方下载 或参考android源码下载方式 Android编 ...

  4. Android源码编译make的错误处理

    android源码下载:官方下载 或参考android源码下载方式 Android编译版本: PLATFORM_VERSION=4.0.1(最新Android 4.0.1) OS 操作系统平台: Li ...

  5. Ubuntu编译Android源码过程中的空间不足解决方法

    Android源码一般几十G,就拿Android5.0来说,下载下来大概也有44G左右,和编译产生的文件以及Ubuntu系统占用的空间加起来,源码双倍的空间都不够有.编译源码前能分配足够的空间再好不过 ...

  6. jdk/java版本与Android源码编译中的错误

    错误一:javap未指向有效的java版本 Traceback (most recent call last): File "../../base/android/jni_generator ...

  7. Linux下编译PHP常见错误及解决方法

    1.configure: error: xml2-config not found. Please check your libxml2 installation.yum install libxml ...

  8. 有关android源码编译的几个问题

    项目用到编译环境,与源码有些差异不能照搬,关键是连源码都没编译过,下面基本上是行网上照的各种自学成才的分享,病急乱投医了,都记在下面作为参照吧. 1.验证是否编译正确,在终端执行 emulator & ...

  9. [Android Pro] Android源码编译之Nexus5真机编译

    reference to : http://blog.csdn.net/liu1075538266/article/details/51272398 1.   前言 在Android安全的研究工作中, ...

随机推荐

  1. c#代码实现GPS数据的有效性校验

    用于校验GPS报文指令的有效性 很简单的代码,留存吧 public static bool Verify(string gpsInfo)         {            if (gpsInf ...

  2. 小学生玩ACM----优先队列

    思来想去,本人还是觉得,这个优先队列啊,不学不行,怎么说咧?虽说有时候我可以模仿它的功能,但是有的题目会坑的我大放血,况且多学会用一个小东东总不会伤身的撒,何况我是永举不垂的,哦耶,嘿嘿 优先队列嘛就 ...

  3. [Mapreduce]eclipse下写wordcount

    上传两个文件到hdfs上的input目录下 代码例如以下: import java.io.IOException; import java.util.StringTokenizer; import o ...

  4. [Ramda] Compose and Curry

    Curry: The idea of Curry is to spreate the data from the function. Using Curry to define the functio ...

  5. PhpStorm, XDebug, and DBGp Proxy

    phpstorm 利用 xdebug.dbgp-proxy配置远程调试 1.单客户机远程调试 a.安装xdebug库文件(windows:php_xdebug.dll;linux:php_xdebug ...

  6. Scala Error: error while loading Suite, Scala signature Suite has wrong version expected: 5.0 found: 4.1 in Suite.class

    准备给scala项目引入单元测试 <dependency> <groupId>org.scalatest</groupId> <artifactId>s ...

  7. 小白日记17:kali渗透测试之缓冲区溢出实例-windows,POP3,SLmail

    缓冲区溢出实例 缓冲区溢出原理:http://www.cnblogs.com/fanzhidongyzby/archive/2013/08/10/3250405.html 空间存储了用户程序的函数栈帧 ...

  8. 使用 MJ 自定义下拉刷新

    // // ViewController.m // Refresh // // Created by Apple on 16/7/19. // Copyright © 2016年 mac. All r ...

  9. PHP中使用kindeditor

    KindEditor是一套开源的HTML可视化编辑器,主要用于让用户在网站上获得所见即所得编辑效果,兼容IE.Firefox.Chrome. Safari.Opera等主流浏览器.KindEditor ...

  10. python(7)– 类的反射

    python中的反射功能是由以下四个内置函数提供:hasattr.getattr.setattr.delattr,改四个函数分别用于对对象内部执行:检查是否含有某成员.获取成员.设置成员.删除成员. ...