Xcode 4.2 编译 Android

Xcode 4.2 已经不带 10.5 sdk 了,试了下把10.6的符号链接到10.5,

ld: warning: ignoring file out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/libSDL.a, file was built for archive which is not the architecture being linked (i386)
Undefined symbols for architecture i386

qemu就是android emulator,这是个host应用,显然这是非常让人恼火的64/32位兼容问题。android build脚本用的是自己的预编译版本。试了一下bypass之,总是有各种问题,而且拿android source一通乱改也总归也不是个办法。后来一样,这何必呢,直接拿ports做了一个universal版本的libsdl,然后在编译到报错之后,把ports里的(/opt/local/lib/libSDL.a)复制到out/host/darwin-x86/obj/STATIC_LIBRARIES/libSDL_intermediates/里,不就完了嘛。

然后编译成功。

 

3 Replies to “Xcode 4.2 编译 Android”

  1. 拿port做指的是port search libsdl
    libsdl @1.2.15 (devel, multimedia) 查询到的第一个吗?
    直接sudo port install libsdl就可以了吗?貌似要加+universal

    完整命令应该是sudo port install libsdl +universal?

    麻烦指导下,谢谢。

  2. 没做这个操作前我ls了下/opt/local/bin,里面就有一个libsdl.a,但是cp过去还是不行。

Leave a Reply

Your email address will not be published. Required fields are marked *