Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我用的是lua-5.1.3和luasocket-2.0.2,做socket.so的时候就可以了。当我需要socket.so时,它失败并给我这个错误:
./socket.so:undefined symbol:luaopen_socket.
由于我的池知识,我不知道如何处理这个问题。你有什么建议吗?
您可以使用nm socket.so它来检查实际存在哪些符号。我怀疑你会找到一个符号luaopen_socket_core(和/或luaopen_mime_core),因为 luasocket 由多个 Lua 模块(例如socket.lua,,socket/http.lua...)和两个 C 模块(socket/core.so和mime/core.so)组成。为了require("socket")工作,您至少需要socket.lua在package.path.
nm socket.so
luaopen_socket_core
luaopen_mime_core
socket.lua
socket/http.lua
socket/core.so
mime/core.so
require("socket")
package.path