I want to implement a function such as embedding a socket function in my Lua assembly. Therefore, I no longer need to copy the socket.core.dll file (just for fun).
I am looking for a miner and see some guys discussing the topic, http://lua-users.org/lists/lua-l/2005-10/msg00269.html
But I have a question for detailed steps that can give me detailed steps for modifying the lua and luasocket code so that they work together (and not with the dll method).
I tried these steps in Windows XP using VC2008:
1) copy the luasocket code into the Lua project.
2) add code
static const luaL_Reg lualibs[] = { {"", luaopen_base}, {LUA_LOADLIBNAME, luaopen_package}, {LUA_TABLIBNAME, luaopen_table}, {LUA_IOLIBNAME, luaopen_io}, {LUA_OSLIBNAME, luaopen_os}, {LUA_STRLIBNAME, luaopen_string}, {LUA_MATHLIBNAME, luaopen_math}, {LUA_DBLIBNAME, luaopen_debug}, {LUA_SOCKETLIBNAME, luaopen_socket_core},
3) build a project and run it.
When I print print(socket._VERSION) , it shows luasocket 2.0.2 , this is correct.
When I type print(socket.dns.toip("localhost")) , it shows 127.0.0.1 table: 00480AD0 , which is also correct.
But when I try to use other functions, for example bind, it cannot work.
Who could explain the reason to me?