How to use Lua 5.2 with luasocket 3

前端 未结 2 1331
南旧
南旧 2021-01-05 00:33

I am trying to compile luasocket 3 that I found on GitHub with lua 5.2. Problem is, I\'m not sure how to bind together Lua with luasocket. Do I nee

2条回答
  •  生来不讨喜
    2021-01-05 00:47

    Usually you only need to reference lua include files (there are only 4 needed: luaconf.h, lua.h, lualib.h, and lauxlib.h) and library/dll (-llua52 in your case). You don't say what compiler you are using, so it's difficult to be more specific, but I have script(s) that build luasocket with lua5.2 on Windows using mingw (and using gcc on OSX/Linux). For example, to compile on Windows, you can get build-win32.sh script and run it as: bash build-win32.sh 5.2 lua luasocket. It will get all the files needed (using wget) and compile everything in deps/ folder; the resulting executable and libraries will be put in ../bin folder.

    You can also get compiled libraries from the same repository.

提交回复
热议问题