lua-users home
lua-l archive

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


On Tuesday 01 August 2006 17:20, Mark Edgar wrote:
> 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

Thanks, I came across that tidbit just after I hit the send button.  Still, I 
appreciate the quick answer.

With that and a little more digging in the manual I got it to work perfectly.  
I guess that's the danger of running an old example with a new interpreter.  
I'll have to do more groundwork next time.

Mike