Reputation: 827
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?
Upvotes: 0
Views: 786
Reputation: 473537
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
.
Upvotes: 2