xcode4 下 wax开发环境的搭建,Error opening wax scripts: loading wax stdlib: bad header in precompiled chunk...

在参考:https://github.com/probablycorey/wax 搭建的过程中,运行官方的例子,console中总是出现:

Error opening wax scripts: loading wax stdlib: bad header in precompiled chunk

经过漫长的查找,最终发现是我的开发机的Lua版本不对,应该这样:

首先,官方文档没提需要在开发机上安装Lua,这个是必须安装的,因为编译脚本需要Lua支持。

Lua在这里下载:http://www.lua.org/download.html

编辑 lua-5.1.4/src/Makefile,将:

macosx:
        $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"

改为:

macosx:
        $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX -arch i386" MYLIBS="-lreadline -arch i386"

最后:

$ make macosx
$ sudo make install

让我发现这个问题,是因为在wax/lib/build-scripts/copy-scripts.sh中,有这样的注释:

# This requires that you run a special build of lua. Since snow leopard is 64-bit
# and iOS is 32-bit, luac files compiled on snow leopard won't work on iOS

另外注意,由于需要重写wax/lib/stdlib/wax_stdlib.h文件,所以要注意此文件是否有写权限,另外在编译时,加上compile-stdlib.sh脚本,以重新编译wax_stdlib.h。

在xcode4下安装wax的教程,以及对应的中文版:

http://mobile.tutsplus.com/tutorials/iphone/iphone-wax/

http://mobile.51cto.com/hot-269986_1.htm

另外,需要注意的是,如果执行安装模板的脚本(虽然在xcode4下装不上,我也提一下),需要在zsh下运行。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值