lua-users home
lua-l archive

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


On 9/13/07, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> > 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)".

It was not in my code snippet but luaL_openlibs(L) is done after
creating the state (I patched luaL_newstate()) so that isn't the
cause.

-- 
Dirk