I have successfully added Lua to a default Xcode template project by following the process described by this very helpful post, and got the "Hello, world." text printing.
However, when I try to add Lua to my existing Cocos2D/Box2d project, following exactly the same process, I get a compile error:
Undefined symbols for architecture i386:
"luaL_newstate()", referenced from ...
My search results on this error refer to one of these possible problems, which I think are OK in my case:
- The target's Build Phases -> Compile Sources - but the same Lua.c files are in both the default template project and my Cocos2D/Box2d project
- I set the header search paths of the default project to match those in the Cocos2D/Box2d project, and the template still compiles fine.
- All the frameworks used by the template project are also in my Cocos2D/Box2d project.
What am I missing?
Any help would be much appreciated. Thanks!