lua-users home
lua-l archive

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


Hi Oliver,

> In 2009, Brian Maher once made a nice libary module to link the zLib library
> to Lua (https://github.com/brimworks/lua-zlib)
> Did anyone managed it to find or make a DLL that I can use for Lua52.exe and the Zerobrane Studio IDE ?

Something like this may work:

set LUA_DIR=D:\Lua\build\lua-5.2
gcc -O2 -shared -s -I ..\zlib -I %LUA_DIR%\src -L ..\zlib -L
%LUA_DIR%\src -o zlib.dll lua_zlib.c -llua52 -lz

This assumes you are building against lua52.dll, the generated dll is
zlib.dll, and zlib itself is in ..\zlib folder (for zlib.h/zconf.h and
.a files).

If you want to use these with ZBS, you'll need to copy zlib.dll (Lua
module) and zlib1.dll (zlib library) to ZBS/bin/clibs52 folder and
select Lua 5.2 as the interpreter.

If you want to build it statically, so that libz1.dll is not needed
(included in zlib.dll), you can use something like this:

gcc -O2 -shared -c -I ..\zlib -I %LUA_DIR%\src -o lua_zlib.o lua_zlib.c
gcc -o zlib.dll -shared -s -L %LUA_DIR%\src lua_zlib.o ..\zlib\libz.a -llua52

Paul.