将 Numlua 放在 LUA_PATH 上
我正在尝试将 numlua 放在我的 LUA_PATH 上,以便我可以从任何地方使用它。它目前位于 /usr/local/lib/lua/5.1/numlua。我可以从 /usr/local/lib/lua/5.1/numlua 内部成功要求它(numlua)。目前,我有默认的 LUA_PATH:
require "numlua"...
no file './numlua.lua'
no file '/usr/local/share/lua/5.1/numlua.lua'
no file '/usr/local/share/lua/5.1/numlua/init.lua'
no file '/usr/local/lib/lua/5.1/numlua.lua'
no file '/usr/local/lib/lua/5.1/numlua/init.lua'
no file '/usr/share/lua/5.1/numlua.lua'
no file '/usr/share/lua/5.1/numlua/init.lua'
no file './numlua.so'
no file '/usr/local/lib/lua/5.1/numlua.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.1/numlua.so'
no file '/usr/lib/lua/5.1/numlua.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
但是,当我尝试从其他地方要求“numlua.numlua”时,说〜/,:(
error loading module 'numlua.numlua' from file '/usr/local/lib/lua/5.1/numlua/numlua.so':
/usr/local/lib/lua/5.1/numlua/numlua.so: undefined symbol: luaopen_numlua_numlua
不用说,要求“numlua”不起作用)。我也尝试过更改我的 LUA_PATH,但是每当目录/文件位于我的 LUA_PATH 上时,我总是会遇到未定义的符号错误。解决这个问题的最佳方法是什么?
I'm trying to put numlua on my LUA_PATH so that I can use it from anywhere. It currently lives in /usr/local/lib/lua/5.1/numlua. I can successfully require it (numlua) from inside of /usr/local/lib/lua/5.1/numlua . Currently, I have the default LUA_PATH:
require "numlua"...
no file './numlua.lua'
no file '/usr/local/share/lua/5.1/numlua.lua'
no file '/usr/local/share/lua/5.1/numlua/init.lua'
no file '/usr/local/lib/lua/5.1/numlua.lua'
no file '/usr/local/lib/lua/5.1/numlua/init.lua'
no file '/usr/share/lua/5.1/numlua.lua'
no file '/usr/share/lua/5.1/numlua/init.lua'
no file './numlua.so'
no file '/usr/local/lib/lua/5.1/numlua.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.1/numlua.so'
no file '/usr/lib/lua/5.1/numlua.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
However, when I try require "numlua.numlua" from somewhere else, say ~/,:
error loading module 'numlua.numlua' from file '/usr/local/lib/lua/5.1/numlua/numlua.so':
/usr/local/lib/lua/5.1/numlua/numlua.so: undefined symbol: luaopen_numlua_numlua
(Needless to say, require "numlua" doesn't work). I've tried to change my LUA_PATH as well, but whenever the directory/files are on my LUA_PATH I always end up with undefined symbol error. What's the best way to solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NumLua 是一个 C 模块 DLL。
LUA_PATH
用于Lua 文件。你知道,以“.lua”结尾的文件。C 模块的搜索路径是
LUA_CPATH
。NumLua is a C module DLL. The
LUA_PATH
is for Lua files. You know, files that end in ".lua".The search path for C modules is
LUA_CPATH
.