• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[Lua-Socket] Ubuntu 14.04 64 bits(Dynamic librairies)

miaxos

Respected Member
Hi. Thank to Rotchet2's help, i figured out how make Lua-Socket works with Eluna on Ubuntu 14.04 64 bits. I think it will work on a 32 bits version, but you have to correct paths. (And also dynamic libraries)

Code:
$cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"

First, you'll have to add this line "#define LUA_USE_LINUX"
https://github.com/ElunaLuaEngine/ElunaTrinityWotlk/blob/master/dep/lualib/luaconf.h#L41

Of course, you could do it in Cmakelist, you do as you want to do.

Now we have to link dl lib to your installation of Eluna

https://github.com/ElunaLuaEngine/ElunaTrinityWotlk/blob/master/dep/lualib/CMakeLists.txt

At the the end of the file,

+set (CMAKE_CXX_LINK_EXECUTABLE "/usr/lib/x86_64-linux-gnu/libdl.so -ldl")
+target_link_libraries(lualib "dl" "/usr/lib/x86_64-linux-gnu/libdl.so")
+set_target_properties(lualib PROPERTIES COMPILE_FLAGS "-ldl")

(Check if paths are correct, if it isn't, fix it.)

As it is now, you have to compile.
It worked for me.

Now about Lua-Socket,

You have to run

Code:
$sudo apt-get install lua-socket

Now, you have to try it in Eluna :

Code:
print("[INFO]: Load Sockets")

package.path = "/usr/share/lua/5.2/?.lua;"..package.path
package.cpath = "/usr/lib/x86_64-linux-gnu/lua/5.2/?.so"..package.cpath

socket = require("socket")
print("[DEBUG]: Socket-Version:"..socket._VERSION)

Be careful with lua-socket, we don't have multi-threading in lua, so you'll have to use coroutines.
 
Last edited:
Top