LUA错误安装依赖失败(luasocket)
LUA error failed installing dependency (luasocket)
luasocket 3.0.0-1 depends on lua >= 5.1 (5.2-1 provided by VM)
mingw32-gcc -O2 -c -o src/mime.o -IC:\lua src/mime.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501
mingw32-gcc -O2 -c -o src/compat.o -IC:\lua src/compat.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501
mingw32-gcc -shared -o mime/core.dll src/mime.o src/compat.o C:\lua/lua52.dll -lm
mingw32-gcc -O2 -c -o src/luasocket.o -IC:\lua src/luasocket.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/timeout.o -IC:\lua src/timeout.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/buffer.o -IC:\lua src/buffer.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/io.o -IC:\lua src/io.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/auxiliar.o -IC:\lua src/auxiliar.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/options.o -IC:\lua src/options.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/inet.o -IC:\lua src/inet.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/except.o -IC:\lua src/except.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/select.o -IC:\lua src/select.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/tcp.o -IC:\lua src/tcp.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/udp.o -IC:\lua src/udp.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/compat.o -IC:\lua src/compat.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/wsocket.o -IC:\lua src/wsocket.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
In file included from src/wsocket.h:11:0,
from src/socket.h:18,
from src/wsocket.c:12:
src/wsocket.c: In function 'socket_gaistrerror':
src/wsocket.c:419:14: error: 'ERROR_NOT_ENOUGH_MEMORY' undeclared (first use in this function)
case EAI_MEMORY: return PIE_MEMORY;
^
src/wsocket.c:419:14: note: each undeclared identifier is reported only once for each function it appears in
Error: Build error: Failed compiling object src/wsocket.o
当我尝试通过命令提示符安装 luasocket 时出现此错误。我唯一能够成功安装的是 DKjson。这是为什么?我该如何修复 luasocket 错误?
我在 Windows 10 上使用 Visual Studio 代码并下载了 luarocks。我想让我的代码使用 URL (web-API) 中的一些值。据我了解,我需要使用“require socket.http”,但这给了我“error missing socket.http”。
module 'socket.http' not found:
no field package.preload['socket.http']
no file 'C:\lua\lua\socket\http.lua'
no file 'C:\lua\lua\socket\http\init.lua'
no file 'C:\lua\socket\http.lua'
no file 'C:\lua\socket\http\init.lua'
no file '.\socket\http.lua'
no file 'C:\lua\socket\http.dll'
no file 'C:\lua\loadall.dll'
no file '.\socket\http.dll'
no file 'C:\lua\socket\http52.dll'
no file '.\socket\http52.dll'
no file 'C:\lua\socket.dll'
no file 'C:\lua\loadall.dll'
no file '.\socket.dll'
no file 'C:\lua\socket52.dll'
no file '.\socket52.dll'
stack traceback:
[C]: in function 'require'
编辑:忘了问:我需要特定的构建结构才能在 VSCode 上使用 API 吗?
通过下载 VM 并在 Ubuntu Linux 上使用 Lua 解决了该问题。
luasocket 3.0.0-1 depends on lua >= 5.1 (5.2-1 provided by VM)
mingw32-gcc -O2 -c -o src/mime.o -IC:\lua src/mime.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501
mingw32-gcc -O2 -c -o src/compat.o -IC:\lua src/compat.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501
mingw32-gcc -shared -o mime/core.dll src/mime.o src/compat.o C:\lua/lua52.dll -lm
mingw32-gcc -O2 -c -o src/luasocket.o -IC:\lua src/luasocket.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/timeout.o -IC:\lua src/timeout.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/buffer.o -IC:\lua src/buffer.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/io.o -IC:\lua src/io.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/auxiliar.o -IC:\lua src/auxiliar.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/options.o -IC:\lua src/options.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/inet.o -IC:\lua src/inet.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/except.o -IC:\lua src/except.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/select.o -IC:\lua src/select.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/tcp.o -IC:\lua src/tcp.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/udp.o -IC:\lua src/udp.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/compat.o -IC:\lua src/compat.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
mingw32-gcc -O2 -c -o src/wsocket.o -IC:\lua src/wsocket.c -DLUASOCKET_DEBUG -DLUASOCKET_INET_PTON -DWINVER=0x0501 -Ic:/mingw/include
In file included from src/wsocket.h:11:0,
from src/socket.h:18,
from src/wsocket.c:12:
src/wsocket.c: In function 'socket_gaistrerror':
src/wsocket.c:419:14: error: 'ERROR_NOT_ENOUGH_MEMORY' undeclared (first use in this function)
case EAI_MEMORY: return PIE_MEMORY;
^
src/wsocket.c:419:14: note: each undeclared identifier is reported only once for each function it appears in
Error: Build error: Failed compiling object src/wsocket.o
当我尝试通过命令提示符安装 luasocket 时出现此错误。我唯一能够成功安装的是 DKjson。这是为什么?我该如何修复 luasocket 错误?
我在 Windows 10 上使用 Visual Studio 代码并下载了 luarocks。我想让我的代码使用 URL (web-API) 中的一些值。据我了解,我需要使用“require socket.http”,但这给了我“error missing socket.http”。
module 'socket.http' not found:
no field package.preload['socket.http']
no file 'C:\lua\lua\socket\http.lua'
no file 'C:\lua\lua\socket\http\init.lua'
no file 'C:\lua\socket\http.lua'
no file 'C:\lua\socket\http\init.lua'
no file '.\socket\http.lua'
no file 'C:\lua\socket\http.dll'
no file 'C:\lua\loadall.dll'
no file '.\socket\http.dll'
no file 'C:\lua\socket\http52.dll'
no file '.\socket\http52.dll'
no file 'C:\lua\socket.dll'
no file 'C:\lua\loadall.dll'
no file '.\socket.dll'
no file 'C:\lua\socket52.dll'
no file '.\socket52.dll'
stack traceback:
[C]: in function 'require'
编辑:忘了问:我需要特定的构建结构才能在 VSCode 上使用 API 吗?
通过下载 VM 并在 Ubuntu Linux 上使用 Lua 解决了该问题。