Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Lua 5.2 with luasocket 3

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 need to compile luasocket as DLL and then reference if somewhere in lua code, or should I just call it from lua console?

like image 632
miller Avatar asked Sep 06 '13 08:09

miller


People also ask

What is the latest version of Lua luasocket?

LuaSocket version 3.0.0 is now available for download! It is compatible with Lua 5.1 through 5.4. Chances are it works well on most UNIX distributions and Windows flavors.

Is it possible to use it in any Lua program?

It is available to any Lua application once it has been properly initialized by the interpreter in use. The code has been tested and runs well on several Windows and UNIX platforms.

Where can I find the lua53 DLL?

dynamic, and in this case, the "lua53.dll" must be findable somewhere in the PATH of the application using the "luasocket" module static, and then the "luasocket" module is self sufficient, no other DLLs are needed the build structure has been re-arranged to include the build target architecture in the build path, with Win32 or x64 possibilities

What is the core support of Lua?

The core support has been implemented so that it is both efficient and simple to use. It is available to any Lua application once it has been properly initialized by the interpreter in use.


1 Answers

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.

like image 124
Paul Kulchenko Avatar answered Oct 13 '22 09:10

Paul Kulchenko