мой код
inline int DOFILE(string& filename) {
printf("lua_open\n");
/* initialize Lua */
lua_State* L = lua_open();
printf("lua_openlibs\n");
/* load Lua base libraries */
luaL_openlibs(L);
printf("lua_dofile\n");
/* run the script */
int ret = luaL_dofile(L, filename.c_str());
printf("lua_close\n");
/* cleanup Lua */
lua_close(L);
return ret;
}
опции компиляции:
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall", "-llua-5.1"]
также пробовал '-llua', '-llualib', все они сообщают о предупреждении
i686-apple-darwin11-llvm-g++-4.2: -llua-5.1: linker input file unused because linking not done
Когда я бегу, он сообщает:
lua_open
dyld: lazy symbol binding failed: Symbol not found: _luaL_newstate
Referenced from: /Users/gl/workspace/node-lua/build/Release/node_lua.node
Expected in: flat namespace
dyld: Symbol not found: _luaL_newstate
Referenced from: /Users/gl/workspace/node-lua/build/Release/node_lua.node
Expected in: flat namespace