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 here

make: *** [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的内存




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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值