2015-01-13 20 views
2

所以我試圖用Luasocket和一個有Lua API的第三方遊戲。它支持軟件包,但它說它需要一些我沒有的luasocket文件(儘管它在IDE之外工作,因爲我在Lua目錄中安裝了Luasocket)。這些似乎是core.dll,core.lua和core/init.lua。我假設我通過編譯Luasocket來獲得這些。編譯Luasocket

我嘗試過,但收效甚微。我發現構建luasocket的腳本總是給我錯誤。我該如何獲得這些文件並編譯它們?

編輯:這是錯誤的Cygwin給我,當我嘗試建立Luasocket:

src/wsocket.c: In function ‘socket_open’: 
src/wsocket.c:19:5: error: unknown type name ‘WSADATA’ 
    WSADATA wsaData; 
    ^
src/wsocket.c:20:5: error: unknown type name ‘WORD’ 
    WORD wVersionRequested = MAKEWORD(2, 0); 
    ^
src/wsocket.c:23:24: error: request for member ‘wVersion’ in something not a structure or union 
    if ((LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 0) && 
         ^
src/wsocket.c:23:57: error: request for member ‘wVersion’ in something not a structure or union 
    if ((LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 0) && 
                 ^
src/wsocket.c:24:24: error: request for member ‘wVersion’ in something not a structure or union 
     (LOBYTE(wsaData.wVersion) != 1 || HIBYTE(wsaData.wVersion) != 1)) { 
         ^
src/wsocket.c:24:57: error: request for member ‘wVersion’ in something not a structure or union 
     (LOBYTE(wsaData.wVersion) != 1 || HIBYTE(wsaData.wVersion) != 1)) { 
                 ^
src/wsocket.c: In function ‘socket_select’: 
src/wsocket.c:82:16: error: ‘DWORD’ undeclared (first use in this function) 
     Sleep((DWORD) (1000*t)); 
       ^
src/wsocket.c:82:16: note: each undeclared identifier is reported only once for each function it appears in 
src/wsocket.c: In function ‘socket_connect’: 
src/wsocket.c:127:16: error: ‘WSAEWOULDBLOCK’ undeclared (first use in this function) 
    if (err != WSAEWOULDBLOCK && err != WSAEINPROGRESS) return err; 
       ^
src/wsocket.c:127:41: error: ‘WSAEINPROGRESS’ undeclared (first use in this function) 
    if (err != WSAEWOULDBLOCK && err != WSAEINPROGRESS) return err; 
             ^
src/wsocket.c: In function ‘socket_accept’: 
src/wsocket.c:180:20: error: ‘WSAEWOULDBLOCK’ undeclared (first use in this function) 
     if (err != WSAEWOULDBLOCK && err != WSAECONNABORTED) return err; 
        ^
src/wsocket.c:180:45: error: ‘WSAECONNABORTED’ undeclared (first use in this function) 
     if (err != WSAEWOULDBLOCK && err != WSAECONNABORTED) return err; 
              ^
src/wsocket.c: In function ‘socket_send’: 
src/wsocket.c:211:20: error: ‘WSAEWOULDBLOCK’ undeclared (first use in this function) 
     if (err != WSAEWOULDBLOCK) return err; 
        ^
src/wsocket.c: In function ‘socket_sendto’: 
src/wsocket.c:233:20: error: ‘WSAEWOULDBLOCK’ undeclared (first use in this function) 
     if (err != WSAEWOULDBLOCK) return err; 
        ^
src/wsocket.c: In function ‘socket_recv’: 
src/wsocket.c:259:20: error: ‘WSAEWOULDBLOCK’ undeclared (first use in this function) 
     if (err != WSAEWOULDBLOCK) { 
        ^
src/wsocket.c:260:24: error: ‘WSAECONNRESET’ undeclared (first use in this function) 
      if (err != WSAECONNRESET || prev == WSAECONNRESET) return err; 
         ^
src/wsocket.c: In function ‘socket_recvfrom’: 
src/wsocket.c:288:20: error: ‘WSAEWOULDBLOCK’ undeclared (first use in this function) 
     if (err != WSAEWOULDBLOCK) { 
        ^
src/wsocket.c:289:24: error: ‘WSAECONNRESET’ undeclared (first use in this function) 
      if (err != WSAECONNRESET || prev == WSAECONNRESET) return err; 
         ^
src/wsocket.c: In function ‘socket_hoststrerror’: 
src/wsocket.c:333:14: error: ‘WSAHOST_NOT_FOUND’ undeclared (first use in this function) 
     case WSAHOST_NOT_FOUND: return "host not found"; 
      ^
src/wsocket.c: In function ‘socket_strerror’: 
src/wsocket.c:341:14: error: ‘WSAEADDRINUSE’ undeclared (first use in this function) 
     case WSAEADDRINUSE: return "address already in use"; 
      ^
src/wsocket.c:342:14: error: ‘WSAECONNREFUSED’ undeclared (first use in this function) 
     case WSAECONNREFUSED: return "connection refused"; 
      ^
src/wsocket.c:343:14: error: ‘WSAEISCONN’ undeclared (first use in this function) 
     case WSAEISCONN: return "already connected"; 
      ^
src/wsocket.c:344:14: error: ‘WSAEACCES’ undeclared (first use in this function) 
     case WSAEACCES: return "permission denied"; 
      ^
src/wsocket.c:345:14: error: ‘WSAECONNABORTED’ undeclared (first use in this function) 
     case WSAECONNABORTED: return "closed"; 
      ^
src/wsocket.c:346:14: error: ‘WSAECONNRESET’ undeclared (first use in this function) 
     case WSAECONNRESET: return "closed"; 
      ^
src/wsocket.c:347:14: error: ‘WSAETIMEDOUT’ undeclared (first use in this function) 
     case WSAETIMEDOUT: return "timeout"; 
      ^
src/wsocket.c: In function ‘wstrerror’: 
src/wsocket.c:359:14: error: ‘WSAEINTR’ undeclared (first use in this function) 
     case WSAEINTR: return "Interrupted function call"; 
      ^
src/wsocket.c:360:14: error: ‘WSAEACCES’ undeclared (first use in this function) 
     case WSAEACCES: return "Permission denied"; 
      ^
src/wsocket.c:361:14: error: ‘WSAEFAULT’ undeclared (first use in this function) 
     case WSAEFAULT: return "Bad address"; 
      ^
src/wsocket.c:362:14: error: ‘WSAEINVAL’ undeclared (first use in this function) 
     case WSAEINVAL: return "Invalid argument"; 
      ^
src/wsocket.c:363:14: error: ‘WSAEMFILE’ undeclared (first use in this function) 
     case WSAEMFILE: return "Too many open files"; 
      ^
src/wsocket.c:364:14: error: ‘WSAEWOULDBLOCK’ undeclared (first use in this function) 
     case WSAEWOULDBLOCK: return "Resource temporarily unavailable"; 
      ^
src/wsocket.c:365:14: error: ‘WSAEINPROGRESS’ undeclared (first use in this function) 
     case WSAEINPROGRESS: return "Operation now in progress"; 
      ^
src/wsocket.c:366:14: error: ‘WSAEALREADY’ undeclared (first use in this function) 
     case WSAEALREADY: return "Operation already in progress"; 
      ^
src/wsocket.c:367:14: error: ‘WSAENOTSOCK’ undeclared (first use in this function) 
     case WSAENOTSOCK: return "Socket operation on nonsocket"; 
      ^
src/wsocket.c:368:14: error: ‘WSAEDESTADDRREQ’ undeclared (first use in this function) 
     case WSAEDESTADDRREQ: return "Destination address required"; 
      ^
src/wsocket.c:369:14: error: ‘WSAEMSGSIZE’ undeclared (first use in this function) 
     case WSAEMSGSIZE: return "Message too long"; 
      ^
src/wsocket.c:370:14: error: ‘WSAEPROTOTYPE’ undeclared (first use in this function) 
     case WSAEPROTOTYPE: return "Protocol wrong type for socket"; 
      ^
src/wsocket.c:371:14: error: ‘WSAENOPROTOOPT’ undeclared (first use in this function) 
     case WSAENOPROTOOPT: return "Bad protocol option"; 
      ^
src/wsocket.c:372:14: error: ‘WSAEPROTONOSUPPORT’ undeclared (first use in this function) 
     case WSAEPROTONOSUPPORT: return "Protocol not supported"; 
      ^
src/wsocket.c:373:14: error: ‘WSAESOCKTNOSUPPORT’ undeclared (first use in this function) 
     case WSAESOCKTNOSUPPORT: return "Socket type not supported"; 
      ^
src/wsocket.c:374:14: error: ‘WSAEOPNOTSUPP’ undeclared (first use in this function) 
     case WSAEOPNOTSUPP: return "Operation not supported"; 
      ^
src/wsocket.c:375:14: error: ‘WSAEPFNOSUPPORT’ undeclared (first use in this function) 
     case WSAEPFNOSUPPORT: return "Protocol family not supported"; 
      ^
src/wsocket.c:376:14: error: ‘WSAEAFNOSUPPORT’ undeclared (first use in this function) 
     case WSAEAFNOSUPPORT: 
      ^
src/wsocket.c:378:14: error: ‘WSAEADDRINUSE’ undeclared (first use in this function) 
     case WSAEADDRINUSE: return "Address already in use"; 
      ^
src/wsocket.c:379:14: error: ‘WSAEADDRNOTAVAIL’ undeclared (first use in this function) 
     case WSAEADDRNOTAVAIL: return "Cannot assign requested address"; 
      ^
src/wsocket.c:380:14: error: ‘WSAENETDOWN’ undeclared (first use in this function) 
     case WSAENETDOWN: return "Network is down"; 
      ^
src/wsocket.c:381:14: error: ‘WSAENETUNREACH’ undeclared (first use in this function) 
     case WSAENETUNREACH: return "Network is unreachable"; 
      ^
src/wsocket.c:382:14: error: ‘WSAENETRESET’ undeclared (first use in this function) 
     case WSAENETRESET: return "Network dropped connection on reset"; 
      ^
src/wsocket.c:383:14: error: ‘WSAECONNABORTED’ undeclared (first use in this function) 
     case WSAECONNABORTED: return "Software caused connection abort"; 
      ^
src/wsocket.c:384:14: error: ‘WSAECONNRESET’ undeclared (first use in this function) 
     case WSAECONNRESET: return "Connection reset by peer"; 
      ^
src/wsocket.c:385:14: error: ‘WSAENOBUFS’ undeclared (first use in this function) 
     case WSAENOBUFS: return "No buffer space available"; 
      ^
src/wsocket.c:386:14: error: ‘WSAEISCONN’ undeclared (first use in this function) 
     case WSAEISCONN: return "Socket is already connected"; 
      ^
src/wsocket.c:387:14: error: ‘WSAENOTCONN’ undeclared (first use in this function) 
     case WSAENOTCONN: return "Socket is not connected"; 
      ^
src/wsocket.c:388:14: error: ‘WSAESHUTDOWN’ undeclared (first use in this function) 
     case WSAESHUTDOWN: return "Cannot send after socket shutdown"; 
      ^
src/wsocket.c:389:14: error: ‘WSAETIMEDOUT’ undeclared (first use in this function) 
     case WSAETIMEDOUT: return "Connection timed out"; 
      ^
src/wsocket.c:390:14: error: ‘WSAECONNREFUSED’ undeclared (first use in this function) 
     case WSAECONNREFUSED: return "Connection refused"; 
      ^
src/wsocket.c:391:14: error: ‘WSAEHOSTDOWN’ undeclared (first use in this function) 
     case WSAEHOSTDOWN: return "Host is down"; 
      ^
src/wsocket.c:392:14: error: ‘WSAEHOSTUNREACH’ undeclared (first use in this function) 
     case WSAEHOSTUNREACH: return "No route to host"; 
      ^
src/wsocket.c:393:14: error: ‘WSAEPROCLIM’ undeclared (first use in this function) 
     case WSAEPROCLIM: return "Too many processes"; 
      ^
src/wsocket.c:394:14: error: ‘WSASYSNOTREADY’ undeclared (first use in this function) 
     case WSASYSNOTREADY: return "Network subsystem is unavailable"; 
      ^
src/wsocket.c:395:14: error: ‘WSAVERNOTSUPPORTED’ undeclared (first use in this function) 
     case WSAVERNOTSUPPORTED: return "Winsock.dll version out of range"; 
      ^
src/wsocket.c:396:14: error: ‘WSANOTINITIALISED’ undeclared (first use in this function) 
     case WSANOTINITIALISED: 
      ^
src/wsocket.c:398:14: error: ‘WSAEDISCON’ undeclared (first use in this function) 
     case WSAEDISCON: return "Graceful shutdown in progress"; 
      ^
src/wsocket.c:399:14: error: ‘WSAHOST_NOT_FOUND’ undeclared (first use in this function) 
     case WSAHOST_NOT_FOUND: return "Host not found"; 
      ^
src/wsocket.c:400:14: error: ‘WSATRY_AGAIN’ undeclared (first use in this function) 
     case WSATRY_AGAIN: return "Nonauthoritative host not found"; 
      ^
src/wsocket.c:401:14: error: ‘WSANO_RECOVERY’ undeclared (first use in this function) 
     case WSANO_RECOVERY: return "Nonrecoverable name lookup error"; 
      ^
src/wsocket.c:402:14: error: ‘WSANO_DATA’ undeclared (first use in this function) 
     case WSANO_DATA: return "Valid name, no data record of requested type"; 
      ^
Error: failed to build LuaSocket 
+0

難道你不能僅僅使用你已經安裝的副本,把它們放在遊戲所在的位置? –

+0

我試過了,但是a)它請求的文件在安裝時找不到,b)我認爲它們是不同的版本(我有一箇舊版本的Luasocket,我相信)或者其他東西,因爲服務器當我在要求的地方添加core.dll時崩潰。無論哪種方式,我想編譯Luasocket只是爲了探索所有途徑 – lordnoob

+0

你找不到哪些文件?你有什麼版本? Luasocket本身的版本可能比應用程序期望的lua版本(以及luasocket的建立版本)要低。 –

回答

0

SO answer可能會有幫助。它提供了關於如何使用gcc進行編譯的詳細信息以及對我使用的編譯腳本的引用,以及針對luasocket 3.0-rc1和Lua 5.2編譯的二進制文件的引用。