[关闭]
@zifehng 2017-06-26T09:21:41.000000Z 字数 2802 阅读 2331

Android编译报错汇总


Ubuntu 16.04
Android 5.0.1

提示缺少sys/types.h

  1. $ make menuconfig
  2. HOSTCC scripts/basic/fixdep
  3. scripts/basic/fixdep.c:106:23: fatal error: sys/types.h: No such file or directory
  4. compilation terminated.
  5. ......

安装libc6-dev与libc6-dev-i386

  1. $ sudo apt-get install libc6-dev libc6-dev-i386

提示缺少dialog.h

  1. $ make menuconfig
  2. ......
  3. In file included from scripts/kconfig/lxdialog/checklist.c:24:0:
  4. scripts/kconfig/lxdialog/dialog.h:31:20: fatal error: curses.h: No such file or directory
  5. compilation terminated.
  6. ......

安装libncurses5-dev

  1. $ sudo apt-get install libnurses5-dev
  1. $ make menuconfig
  2. ......
  3. /usr/bin/ld: cannot find -lncurses
  4. /usr/bin/ld: cannot find -ltinfo
  5. collect2: error: ld returned 1 exit status
  6. ......

安装lib32ncurses5-dev

  1. $ sudo apt-get install lib32ncurses5-dev

编译mboot时报错

  1. /bin/sh: 1: Syntax error: Missing '))'

重新配置dash,选择no

  1. sudo dpkg-reconfigure dash

Ubuntu安装的时候使用了dash,dash比bash体积小速度快,兼容性高!但是在bash下可以正常运行的一些sh在dash下不能使用,造成了一些麻烦。为了解决之,键入sudo dpkg-reconfigure dash,重新配置dash,并选择“no”,即不使用dash。


  1. make: *** [out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Broken pipe
  2. make: *** Deleting file 'out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp'
  3. make: *** Waiting for unfinished jobs....
  4. make: *** [out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Broken pipe
  1. $ sudo apt-get install bison

  1. /bin/bash: gperf: command not found
  1. $ sudo apt-get install gperf

  1. xxxxxx: error: unsupported reloc 43
  1. $ make clean

http://stackoverflow.com/questions/36048358/building-android-from-sources-unsupported-reloc-43


  1. make: *** No rule to make target 'external/chromium_org/third_party/angle/.git/index', needed by 'out/target/product/wwt/obj/GYP/shared_intermediates/angle/id/commit.h'. Stop.

external/chromium_org/third_party/angle/src/commit_id.target.linux-arm.mk
external/chromium_org/third_party/angle/src/commit_id.target.linux-arm64.mk

  1. $(gyp_shared_intermediate_dir)/angle/id/commit.h: $(gyp_shared_intermediate_dir)/angle/commit_id.py $(LOCAL_PATH)/third_party/angle/.git/index$(GYP_TARGET_DEPENDENCIES)
  2. --------------------------------------------------------------------------
  3. $(gyp_shared_intermediate_dir)/angle/id/commit.h: $(gyp_shared_intermediate_dir)/angle/commit_id.py #$(LOCAL_PATH)/third_party/angle/.git/index$(GYP_TARGET_DEPENDENCIES)

external/chromium_org/Android.mk

  1. ......
  2. ifneq (,$(wildcard $(CHROMIUM_DIR)/GypAndroid.$(HOST_OS)-$(TARGET_ARCH).mk))
  3. ......
  4. include $(addsuffix .$(HOST_OS)-$(TARGET_ARCH).mk,$(GYP_MAKEFILE_STEMS))
  5. endif
  6. ......
  7. ifneq (,$(wildcard $(CHROMIUM_DIR)/GypAndroid.$(HOST_OS)-$(TARGET_2ND_ARCH).mk))
  8. ......
  9. include $(addsuffix .$(HOST_OS)-$(TARGET_2ND_ARCH).mk,$(GYP_MAKEFILE_STEMS))
  10. endif
  11. ......

  1. error: unsupported reloc 43
  1. cp /usr/bin/ld.gold prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/x86_64-linux/bin/ld

http://stackoverflow.com/questions/36048358/building-android-from-sources-unsupported-reloc-43

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注