我正在xcode上用cocos2d-x编写一个游戏,而且我在为armv7 7/7编译一个正确版本的Lua时遇到了问题。
下面是我收到的错误消息:
ld: warning: ignoring file
/Users/seriousgames/Documents/PopulationTest/PopulationTest/libs/lua/liblua.a, file was built for archive which is not the architecture being linked (armv7): /Users/seriousgames/Documents/PopulationTest/PopulationTest/libs/lua/liblua.a
Undefined symbols for architecture armv7:
"_luaL_newstate", referenced from:
Behavior::onTerminate(Status) in Behavior.o
"_luaL_openlibs", referenced from:
Behavior::onTerminate(Status) in Behavior.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
如果我选择为macosx编译(而不是iOS),LUA确实可以工作。
编辑:i最后使用了Lua版本5.1.4的旧版本,并遵循这里的说明:http://blog.stokedsoftware.com/blog/2012/02/05/scripting-ios-games-with-lua-part-ii/此方法不需要lualib.a外部库,而是将lua源代码构建到项目中。
注意:虽然他的代码在目标C中,但我发现他的方法确实适用于cocos2d-x。
他特别将lua.c和luac.c文件排除在构建之外。我选择不这样做,但我注释掉了int ()函数,因为它们将与main.m中的函数发生冲突。我会稍作标记这个问题的答案,但我仍然有兴趣知道如何为arm7 7/7建造一个libla.a。
发布于 2013-04-09 03:44:08
见编辑:
编辑:我最后使用了版本5.1.4的Lua的旧版本,并遵循这里的说明:http://blog.stokedsoftware.com/blog/2012/02/05/scripting-ios-games-with-lua-part-ii/这个方法不需要lualib.a外部库,而是将lua源代码构建到项目中。
注意:虽然他的代码在目标C中,但我发现他的方法确实适用于cocos2d-x。
他特别将lua.c和luac.c文件排除在构建之外。我选择不这样做,但我注释掉了int ()函数,因为它们将与main.m中的函数发生冲突。我会稍作标记这个问题的答案,但我仍然有兴趣知道如何为arm7 7/7建造一个libla.a。
https://stackoverflow.com/questions/15876532
复制相似问题