lua-users home
lua-l archive

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


Just installed lua 5.2.2 with: make macosx;make install (working fine it looks).
The to installing lpeg 0.11
Alas, lots of errors. Why?
env  gcc -shared -fPIC lpvm.o lpcap.o lptree.o lpcode.o lpprint.o -o lpeg.so
Undefined symbols for architecture x86_64:
  "_luaL_addlstring", referenced from:
      _stringcap in lpcap.o
      _substcap in lpcap.o
  "_luaL_addvalue", referenced from:
      _addonestring in lpcap.o
…many more…
      ...
  "_lua_typename", referenced from:
      _addonestring in lpcap.o
      _val2str in lptree.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [lpeg.so] Error 1

The changed in the makefile to: LUADIR = /usr/include/lua5.2/ (instead of 5.2) idem /usr/local/include: not working

my path values:
LUA_VERSION=5.2
LUA_DIR=/usr/local
LUA_INCL=$LUA_DIR/include
LUA_SHAREDIR=$LUA_DIR/share/lua/$LUA_VERSION
LUA_LIBDIR=$LUA_DIR/lib/lua/$LUA_VERSION
LUA_PATH="./?.lua;./?/?.lua;$LUA_SHAREDIR/?.lua;$LUA_SHAREDIR/?/?.lua"
LUA_CPATH="./?.so;./?/?.so;$LUA_LIBDIR/?.so;$LUA_LIBDIR/?/?.so"
(all exported of course)

Where does it go wrong?

Hans van der Meer


On 27 mrt. 2013, at 20:23, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:

What is LPeg? LPeg is a new (well, not that new now) pattern-matching
library for Lua, based on Parsing _expression_ Grammars (PEGs).

What is new in version 0.11?

 + complete reimplementation of the code generator
 + new syntax for table captures
 + new functions in module 're'
 + other small improvements

Where to get it?

 http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-0.11.tar.gz

(The implementation of LPeg became too complex. I spent a long time
trying to document it so that I could understand it again, but in the
end I had to give up and accept that I could not maintain it as it
was.  So, I reimplemented the code generator [the real complicated part]
almost from scratch.  The new implementation is somewhat larger than the
old one, because now it first creates an AST for each _expression_ and
later compiles the AST into opcodes for the virtual machine. But now I
can understand the optimizations.)

-- Roberto




Hans van der Meer