我正在尝试将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上时,我总是会遇到未定义的符号错误。解决这个问题的最佳方法是什么?
答案 0 :(得分:2)
NumLua是一个C模块DLL。 LUA_PATH
适用于 Lua 文件。你知道,文件以“.lua”结尾。
C模块的搜索路径为LUA_CPATH
。