lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> lua_State* L = luaL_newstate();
> if (luaL_dofile(L, "strict.lua")) {
>   printf("failed to load strict.lua: %s\n", lua_tostring(L, -1));
> }
> 
> However, this fails and the error is "C stack overflow"

You need luaL_openlibs(L) before luaL_dofile here. But the error message
should have been "attempt to call global 'getmetatable' (a nil value)".