将 Numlua 放在 LUA_PATH 上

发布于 2025-01-08 07:00:27 字数 1124 浏览 2 评论 0原文

我正在尝试将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幽蝶幻影 2025-01-15 07:00:27

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文