在 Ubuntu 上将 IUP 与 Lua 结合使用
我正在尝试让 IUP 在 Ubuntu 上运行。我从 sourceforge 下载了二进制文件,这些库似乎位于 /usr/lib/libiup*.so 中,但是当我编写如下脚本时:
require("iuplua")
iup.Message('Testing App!', 'Finished Successfully!')
我收到一个错误:
lua: attempt to call a nil value
stack traceback:
[C]: ?
[C]: in function 'require'
test.lua:1: in main chunk
[C]: ?
查看它,我看到一条消息指出有人似乎已经修复了它 - 他们的“LD_LIBRARY_PATH 没有指向正确的 cd 和 im 目录”或类似的东西。我似乎无法使用 LD_LIBRARY_PATH 环境变量来纠正我的问题。我看到 2008 年的另一篇注释说“IUPLua 二进制文件对 lua 字节码进行了硬编码,导致了错误”。我尝试从源代码进行编译,但出现与 cd.h 相关的错误。
任何帮助将非常感激。谢谢!
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 write 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查看以下内容,也许会有帮助。
当您使用 require 加载模块时,Lua 使用包路径来确定在哪里查找该模块。
查看 Lua 手册的这一部分: 模块。具体来说,是关于 package.path 和 package.cpath 的部分。
您可以检查当前路径是什么样的:
您可以附加路径,例如:
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.
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:
You can append the paths like: