简体   繁体   English

如何将.lua编译为Windows .exe?

[英]How to compile .lua into Windows .exe?

Question related to Windows platform only. 仅与Windows平台有关的问题。

I can't find documentation on how to approach this. 我找不到有关如何解决此问题的文档。

There are dozens of posts about this, yet most provide answers for mac/linux, most windows specific parts lead to dead links or README's that have no useful information. 有很多关于此的文章,但是大多数文章提供了针对mac / linux的答案,大多数Windows特定部分导致了死链接或自述文件,而这些书没有有用的信息。

How do I, for example, make an .exe of the code below? 例如,如何使以下代码成为.exe? The intent being to share it with another windows user, so that when they click it...it automatically runs the program in command prompt or wherever .exe are supposed to run without them needing to have lua/luac installed on their system. 目的是与其他Windows用户共享该文件,以便当他们单击它时...它会在命令提示符下或应在任何要运行.exe的位置自动运行程序,而无需在他们的系统上安装lua / luac。

Or perhaps I'm missing the point here and you need lua/luac installed, otherwise you would need to convert to a program language that's already installed on everyones' windows systems like C...? 或者,也许我在这里没有抓住重点,您需要安装lua / luac,否则您将需要转换为已经在每个人的Windows系统(如C ...)上安装的程序语言? Regardless I need something that works for the purpose described. 无论如何,我都需要能达到上述目的的东西。 Could I make a folder with lua.exe and luac.exe and input.lua and make an .exe that loads command prompt and runs the command to compile input.lua? 我可以用lua.exe和luac.exe以及input.lua制作一个文件夹,然后制作一个.exe来加载命令提示符并运行命令来编译input.lua吗? new_folder: lua.exe, luac.exe, input.lua, run.exe new_folder:lua.exe,luac.exe,input.lua,run.exe

> --input.lua   
print("type ur name")   
name=io.read()   
print(#name)   
print("your name is " name)  

I'm not aware of anything in wxlua that can compile a lua file into an executable. 我不知道wxlua中可以将lua文件编译成可执行文件的任何内容。 There is wxLuaFreeze executable that allows to concatenate a lua script to it to generate a new executable that will run that script when executed. 有wxLuaFreeze可执行文件,它允许将lua脚本连接到它,以生成一个新的可执行文件,该可执行文件在执行时将运行该脚本。 See the documentation for details: http://wxlua.sourceforge.net/docs/wxlua.html#C7.3 . 有关详细信息,请参见文档: http : //wxlua.sourceforge.net/docs/wxlua.html#C7.3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM