|
Rodrigo Araújo wrote:
You shouldn't call the luaopen_* functions directly.. you need to do a lua_pushcfunction, lua_call (or lua_pcall) series...19 static void openstdlibs( lua_State *l ) 20 { 21 const luaL_reg *lib = lualibs; 22 for (; lib->func; lib++) 23 { 24 lib->func(l); 25 lua_settop(l, 0); 26 } 27 }
You could use luaL_openlibs, which makes this function a one-liner...