mil*_*ler 9 windows lua luasocket lua-5.2
我正在尝试编译我在GitHub上使用lua 5.2找到的luasocket 3.问题是,我不知道如何结合在一起使用.我是否需要编译为DLL然后引用代码中的某个地方,或者我应该从lua控制台调用它?Lualuasocketluasocketlua
小智 4
尝试使用luarocks安装它。如果您没有 luarocks,请按照网站上的说明进行安装。
然后从 luasocket repo 下载 rockspec 文件(luasocket-scm-0.rockspec)并运行
$ luarocks install *path to the rockspec file*
Run Code Online (Sandbox Code Playgroud)
如果一切顺利,您将能够像这样使用 Lua 中的 luasocket:
local socket = require "socket"
-- now you can use socket.xxx functions
Run Code Online (Sandbox Code Playgroud)