2013年1月3日星期四

Lua on C++

I am adding Lua script support in my C++ project targeted on iOS. There are errors when building on simulator.

Undefined symbols for architecture i386:
    "lua_gettop(lua_State*)", referenced from:
    "lua_resume(lua_State*, lua_State*, int)", referenced from:
...
..
.
To solve it, add "extern "C" " symbol to the include keywords to lua headers.

#ifdef __cplusplus
extern "C" {
#include "lua.h"
}
#endif


Reference: StackOverFlow

沒有留言:

發佈留言