luamingw32gcc4.8lpeg

How to build lpeg on windows?


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.


Solution

  • 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.