Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器

首页 / 操作系统 / Linux / Mac OS X Lion 下编译Android 源码

在Mac OS X Lion编译Android 源码,按照官网和网上的资料进行时,我遇到了一些问题,总结一下:1、错误信息:./external/elfutils/config-compat-darwin.h:42: error: static declaration of ‘strnlen’ follows non-static declaration/usr/include/string.h:143: error: previous declaration of ‘strnlen’ was heremake: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libelf_intermediates/lib/xmalloc.o] Error 1网上的资料说打开./external/elfutils/config-compat-darwin.h这个文件,把static inline size_t strnlen (const char *__string, size_t __maxlen){int len = 0;while (__maxlen-- && *__string++)len++;return len;}  这个函数用宏给括起来,我干脆给删掉了,当然先把这个文件给备份了。再次执行make时2、错误信息Undefined symbols for architecture i386:网上资料说把external/qemu/Android.mk这个文件全部注释掉再次执行make,就没有出现error了,并在/out/target/product/generic下面生成了ramdisk.img,system.img,userdata.img三个文件。我用的是make -j8 ,我的是4核,8个G的内存。更多Android相关信息见Android 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=11