I am trying to use Lua on the iphone. On Mac OSX, in a normal Cocoa application (not iPhone), I used the following code:
lua_State* l; l = lua_open(); luaL_openlibs(l); luaL_loadstring(l, "print(\"hi from LUA\");"); lua_pcall(l, 0, 0, 0);
I downloaded Lua 5.1.4 from lua.org/ftp and I compiled it for Mac OSX.
In the Xcode project, I have used "add existing framework" to add liblua.a
and I have used "add existing files" to add the include directory.
This works as expected, and prints the string: "hi from LUA". When I try the same thing in a iPhone project, it gives the errors:
"_luaL_newstate", referenced from: _main in main.o more of the same thing... symbol(s) not found collect2: ld returned 1 exit status
It seems that the .a file is not linked into the iPhone app. Does anybody know how to make this work?
By the way, I do not really care that Apple might not accept my app if it has Lua in it.