lua-users home
lua-l archive

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


On Wed, Apr 30, 2014 at 2:29 PM, Thijs Schreijer
<thijs@thijsschreijer.nl> wrote:
> On what line do you get that? On my system it works as expected. But because you do it embedded; have you opened the standard libraries? I suspect that the 'print' function is not available.

Oh yes!  I did that recently, went mad briefly until the "d'oh" moment.

But is the error coming from the script?  Usually you'd do something
like (error checking omitted)

lua_getglobal(L,"fun_x");
lua_pcall(L,0,0,0);

And that could blow up if Lua can't find fun_x.  That can happen if
you load the script, but forget to call the returned chunk - since
only then are the functions actually created.