lua编译需要错误

发布于 2024-11-30 02:23:36 字数 134 浏览 1 评论 0原文

使用 srlua 将 lua 文件编译为独立程序(即 exe)后,出现大量错误。

以后总是找不到“require()”中的任何内容,并且程序将根本无法运行。

有没有办法解决这个问题,让程序正常运行?

谢谢。

I get tons of errors after I compile a lua file into a stand-alone program (i.e. exe) with srlua.

Always anything in the "require()" it cannot find later and the program will simply not run.

Is there a way to solve this and so the program will run properly?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

故人如初 2024-12-07 02:23:36

当您执行 require 时,默认方法会根据 lua.exe 的位置扫描目录。 srLua 似乎不处理依赖关系。也许你应该使用 Lua 内置程序 来代替。该项目似乎已被放弃,但它确实在 2010 年发布过,所以它大多是最近的。

When you execute require, the default methods scan directories based on the location of lua.exe. srLua seems to not handle dependencies. Perhaps you should use Lua Built-In Program instead. The project seems to be abandoned, but it did have a release in 2010, so it's mostly recent.

等往事风中吹 2024-12-07 02:23:36

我最近使用 Squish 收集了一堆 Lua 模块和几个相关的模块,取得了很好的效果脚本放在一起,以便它们可以与其主机应用程序一起打包在单个 exe 中。

我确实必须进行一些调整才能在 Windows 中构建和使用它,但它们都是以 Unix 为中心的现有源代码套件的明显扩展或翻译。 Squish 本身是用纯 Lua 编写的,构建它时会将 smish 应用于自身,以生成一个独立的脚本文件,以便与普通 Lua 解释器一起使用。

除了处理依赖模块之外,它还可以编译和/或压缩代码以获得更小的输出。

如果您正在使用现有的 Lua 解释器,那么使用 Squish 获取单个文件并使用 srlua 将其与解释器打包可能是一个不错的组合。

I have had good results from using Squish recently to collect a bunch of Lua modules and several related scripts together so that they could be packaged in a single exe along with their host app.

I did have to make some tweaks to build and use it in Windows, but they were all obvious extensions or translations of the Unix-centric existing source kit. Squish itself is written in pure Lua, and building it applies squish to itself to generate a single self-contained script file for use with the normal Lua interpreter.

In addition to handling dependent modules, it can also compile and/or compress the code for even smaller output.

If you are working with the stock Lua interpreter, then using Squish to get a single file and srlua to package it with the interpreter is probably a good combination.

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