Using IUP with Lua on Ubuntu
I'm trying to get IUP working on Ubuntu. I downloaded the binaries from sourceforge and the libraries seem to be in place in /usr/lib/libiup*.so, but when I wr开发者_C百科ite a script like the following:
require("iuplua")
iup.Message('Testing App!', 'Finished Successfully!')
I get an error:
lua: attempt to call a nil value
stack traceback:
[C]: ?
[C]: in function 'require'
test.lua:1: in main chunk
[C]: ?
Looking into it, I saw a message noting that someone seemed to have fixed it - their "LD_LIBRARY_PATH did not point to the right cd and im directories" or something similar. I couldn't seem to correct my problem w the LD_LIBRARY_PATH environment variable. I saw another note from 2008 saying that the "IUPLua binaries have hardcoded lua bytecode that is causing the error". I tried to compile from the sources, but I'm getting errors related to cd.h.
Any help would be -greatly- appreciated. Thanks!
Here is something you can check out, perhaps it will help.
When you load a module with require Lua uses the package paths to determine where to look for the module.
package.path: Where Lua looks for .lua modules
package.cpath: Where Lua looks for .so/.dll modules
Have a look at this section of the Lua manual: Modules. Specifically, the section on package.path and package.cpath.
You can check what the current paths are like:
print(package.path.."\n"..package.cpath)
You can append the paths like:
package.path = package.path..";/usr/lib/?.lua"
package.cpath = package.cpath..";/usr/lib/?.so"
精彩评论