2

我已经从http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-0.12.tar.gz下载了 lpeg 源代码 如何获取 dll?我不能用包含的makefile来做到这一点。我正在使用mingw32。

4

2 回答 2

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.

于 2014-09-29T14:41:36.180 回答
0

您可以使用从 lpeg 文件夹运行的这个简单的批处理文件:

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

只需将 LUA_DIR 文件夹设置为安装 Lua 的文件夹即可;它适用于 Lua 5.1 和 Lua 5.2。

于 2014-09-29T16:22:46.323 回答