lua-users home
lua-l archive

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


Michael Surette wrote:
PANIC: unprotected error in call to Lua API (no calling environment)

How do I provide a calling environment?

This should be answered in a FAQ somewhere.

http://www.lua.org/manual/5.1/manual.html#5

The Lua manual mentions that the luaopen_* functions "should not be called directly: you must call them like any other Lua C function, e.g., by using lua_call."

Simply call luaL_openlibs(), or if you only want a certain subset of the standard libraries opened, see linit.c and modify it to suit your needs.

					-Mark