I use Lua-5.1.3 and luasocket-2.0.2.It is all right when I make the socket.so. When I require socket.so,it failed and give me this error:
./socket.so:undefined symbol:luaopen_socket.
Because of my pool knowledge, I don't know how to handle the problem. Do you have some suggestions?
You can use
nm socket.so
to check which symbols are actually there. I suspect you will find a symbolluaopen_socket_core
(and/orluaopen_mime_core
), because luasocket consists of multiple Lua modules (e.g.socket.lua
,socket/http.lua
, ...) and two C modules (socket/core.so
andmime/core.so
). Forrequire("socket")
to work you will need at leastsocket.lua
somewhere in yourpackage.path
.