如何在Windows上使用LuaRocks安装lua-zlib?

问题描述 投票:0回答:1

我已经在Linux环境中用Lua编写了一个程序,它使用Lua模块ZipWriter及其依赖项(lua-zlibstruct)。我也试图发布到Windows,但是在构建lua-zlib时遇到了麻烦。

我正在使用LuaRocks通过标准命令安装所有其他软件包。因此,要安装lua-zlib,我只使用了lua-zlib,但是它当然不起作用,因为没有安装> luarocks install lua-zlib本身,并且zlib是对该库的绑定。

zlib

因此,我在该页面中找到lua-zlib,用于Windows的Installing https://luarocks.org/lua-zlib-1.2-0.src.rock Error: Could not find header file for ZLIB No file zlib.h in c:/external/include No file zlib.h in c:/mingw/include No file zlib.h in c:/windows/system32/include You may have to install ZLIB in your system and/or pass ZLIB_DIR or ZLIB_INCDIR to the luarocks command. Example: luarocks install lua-zlib ZLIB_DIR=/usr/local 的不同下载。我下载了“完整包,除了源代码”和“源代码”安装程序,并安装它们,他们在目录a link下创建了与zlib相关的文件夹和文件。我遵循了该错误日志提供的示例,并尝试再次运行C:\Program Files (x86)\GnuWin32

zlib

但同样,另一个错误:

luarocks

事实上,> luarocks install lua-zlib ZLIB_DIR="C:\Program Files (x86)\GnuWin32" 中没有文件/目录,如错误所示。由于某种原因,未安装。我想念什么?

注意:如错误日志所示,如果有用,我将Installing https://luarocks.org/lua-zlib-1.2-0.src.rock mingw32-gcc -O2 -c -o lua_zlib.o -IC:\lua\luajit lua_zlib.c -DLZLIB_COMPAT -IC:\Program Files (x86)\GnuWin32/include mingw32-gcc -shared -o zlib.dll lua_zlib.o -lC:\Program Files (x86)\GnuWin32/zlib C:\lua\luajit/lua51.dll -lMSVCRT c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: cannot find -lC:\Program Files (x86)\GnuWin32/zlib collect2.exe: error: ld returned 1 exit status Error: Build error: Failed compiling module zlib.dll 作为编译器。

我已经在Linux环境中用Lua编写了一个程序,它使用Lua模块ZipWriter及其依赖项(lua-zlib和struct)。我也试图发布到Windows,但是我有...

windows lua zlib luarocks
1个回答
0
投票

它应该使用静态zlib代替。为此,您可以在Github上遵循此C:\Program Files (x86)\GnuWin32/zlib。基本上,您需要

© www.soinside.com 2019 - 2024. All rights reserved.