lua-users home
lua-l archive

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


2014-04-16 15:29 GMT+02:00 Roberto Ierusalimschy <roberto@inf.puc-rio.br>:
>> After changing line 32 in lptypes.h from:
>>
>> #if (LUA_VERSION_NUM == 502)
>>
>> to
>>
>> #if (LUA_VERSION_NUM >= 502)
>>
>> 'make' succeeded in building a version of lpeg.so that gives the correct
>> result.
>
> That is still strange. With the old test (LUA_VERSION_NUM == 502), the
> compilation should produce lots of warnings (e.g., "implicit declaration
> of function ‘lua_getfenv’"), and then the dynamic linker would produce
> a corresponding error:
>
>   ../lua/lua: error loading module 'lpeg' from file './lpeg.so':
>         ./lpeg.so: undefined symbol: lua_getfenv

Yes, I did get those ­this morning at 4:30 AM (I did not sleep
well with this thing hanging over me). First, I renamed
/usr/local/include to make sure the 5.2 headers were
invisible. Then I copied the 5.3 headers into the same
directory as LPeg and just said `LUADIR=.`, which produced
those errors, so that require"lpeg" failed.

That made me wonder why I did not get them before, and
I discovered that I had to change LUADIR to be not the
top-level directory into which lua-5.3.0-work2.tar.gz
untars itself, but the src subdirectory of it. Otherwise
it would not find any headers and fall back on the ones
in /usr/local/include.