简体   繁体   中英

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

This error comes up when I try to install luasocket through command prompt. The only rock I have been able to successfully install was DKjson. Why is that? And how can I fix the luasocket error?

I am using Visual Studio Code on Windows 10 and downloaded luarocks. I want to get my code working with some values from an URL (web-API). As I understand I need to use "require socket.http" but that gives me "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'

Edit: Forgot to ask: Do i need a certain build structure to use the API on VSCode?

Fixed the issue, by downloading a VM and using Lua on Ubuntu Linux.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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