2

I've downloaded lpeg source code from http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-0.12.tar.gz How to get the dll? I can't do it with the makefile included. I'm using mingw32.

2 Answers2

0

First change the LUADIR variable to the correct location of your Lua include files. Then add the following make target (using the correct path to your Lua DLL):

mingw: $(FILES)
    $(CC) $(CFLAGS) -shared $(FILES) -o lpeg.dll C:\path\to\lua52.dll

I also had to change CC from gcc to mingw32-gcc, but that might just be my broken MinGW installation.

make mingw

should work now.

siffiejoe
  • 4,141
  • 1
  • 16
  • 16
0

You can use this simple batch file running from lpeg folder:

set LUA_DIR=D:\lua-5.2
gcc -O2 -shared -s -I %LUA_DIR%\src -L %LUA_DIR%\src -o lpeg.dll lptree.c lpvm.c lpcap.c lpcode.c lpprint.c -llua52

Just set LUA_DIR folder to the folder with your Lua installation; it works with both Lua 5.1 and Lua 5.2.

Paul Kulchenko
  • 25,884
  • 3
  • 38
  • 56