简体   繁体   English

无法在 Windows 上从 LuaRocks 安装 LuaSocket

[英]Not able to install LuaSocket from LuaRocks on Windows

I installed the LuaRocks legacy package which includes Lua 5.1 on Windows.我在 Windows 上安装了 LuaRocks 旧版 package,其中包括 Lua 5.1。 But when I run luarocks install luasocket , I get the following output:但是当我运行luarocks install luasocket时,我得到以下 output:

Installing https://luarocks.org/luasocket-3.0rc1-2.src.rock

luasocket 3.0rc1-2 depends on lua >= 5.1 (5.1-1 provided by VM)
mingw32-gcc -O2 -c -o src/mime.o -IC:\Program Files (x86)\LuaRocks\include src/mime.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport)
mingw32-gcc -shared -o mime/core.dll src/mime.o C:\Program Files (x86)\LuaRocks/lua5.1.dll -lMSVCR80
mingw32-gcc -O2 -c -o src/luasocket.o -IC:\Program Files (x86)\LuaRocks\include src/luasocket.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/timeout.o -IC:\Program Files (x86)\LuaRocks\include src/timeout.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/buffer.o -IC:\Program Files (x86)\LuaRocks\include src/buffer.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/io.o -IC:\Program Files (x86)\LuaRocks\include src/io.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/auxiliar.o -IC:\Program Files (x86)\LuaRocks\include src/auxiliar.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/options.o -IC:\Program Files (x86)\LuaRocks\include src/options.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/inet.o -IC:\Program Files (x86)\LuaRocks\include src/inet.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/except.o -IC:\Program Files (x86)\LuaRocks\include src/except.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/select.o -IC:\Program Files (x86)\LuaRocks\include src/select.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/tcp.o -IC:\Program Files (x86)\LuaRocks\include src/tcp.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/udp.o -IC:\Program Files (x86)\LuaRocks\include src/udp.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/wsocket.o -IC:\Program Files (x86)\LuaRocks\include src/wsocket.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) -Ic:/mingw/include
In file included from src/wsocket.h:11:0,
                 from src/socket.h:18,
                 from src/wsocket.c:10:
src/wsocket.c: In function 'socket_gaistrerror':
src/wsocket.c:417:14: error: 'ERROR_NOT_ENOUGH_MEMORY' undeclared (first use in this function)
         case EAI_MEMORY: return "memory allocation failure";
              ^
src/wsocket.c:417:14: note: each undeclared identifier is reported only once for each function it appears in

Error: Build error: Failed compiling object src/wsocket.o

What should I do install LuaSocket?安装 LuaSocket 应该怎么做?

There is a ticket for this where they suggest using Mingw-w64 and x86_64 as architecture, and sj_lj for exception model.有一张票,他们建议使用 Mingw-w64 和 x86_64 作为架构,使用 sj_lj 处理异常 model。 But it does not appear to be resolved.但它似乎没有得到解决。 https://github.com/diegonehab/luasocket/issues/241 https://github.com/diegonehab/luasocket/issues/241

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM