lua-users home
lua-l archive

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



Hi,

Roberto Ierusalimschy wrote:
There is a new version of Lpeg available. Main changes:

Somehow I can not get the new version of lpeg.c to link statically
(I had not problems with the previous two versions).

The C compile runs fine, but when I try to run the executable I
always get this error from within luaopen_lpeg():

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

Can someone please help me? I am probably missing something obvious,
I simply do not understand what is happening. I could find out that
the problem is from the lua_replace() line below, but that does not
make it any clearer to me. There is a similar-looking (to me)
construct in liolib.c, where it gives no trouble at all.

  int luaopen_lpeg (lua_State *L) {
    lua_newtable(L);
    lua_replace(L, LUA_ENVIRONINDEX);  /* HERE */


Thanks in advance for any pointers,

Taco