Haxe - 生成 Exe (cpp)

发布于 2024-08-03 06:50:24 字数 129 浏览 3 评论 0原文

我被指示下载并安装 FlashDevelop,看起来不错,但我不知道在 Haxe 中编写程序时如何生成 exe 文件。我尝试在 FlashDevelop 中构建或运行该项目,但它什么也没做。有人可以建议我如何做到这一点吗?

谢谢

I've been instructed to download and install FlashDevelop and it seems fine but I don't know how to generate exe files when writing programs in Haxe. I try to Build or Run the project in FlashDevelop BUT it just doesn't do anything. Can anybody please advise me on how to do this?

Thank you

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

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

发布评论

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

评论(1

橘香 2024-08-10 06:50:24

CPP 目标是 Haxe 世界中最年轻的目标,因此仍然有点粗糙;增加了更多的复杂性,因为它依赖于外部工具才能正常工作。

有了这个前提,尝试在 FlashDevelop 中创建一个新的 Haxe/CPP 项目,打开 Main 类并添加一个简单的 trace("hello world!"); 行。按 F5 启动“编译并运行”过程。
您将在状态栏中看到消息“构建已开始...”,并且您可以查看“输出面板”来跟踪该过程。如果您的环境设置正确,它将编译整个项目并打开一个 DOS 窗口,在其中执行生成的可执行文件(您可以在 bin 文件夹中找到它)。

如果您收到错误,则说明您的环境尚未准备好使用 Haxe 构建 CPP 应用程序。要解决此问题,请按照设置说明进行操作,您可以在此处。

生成本机可执行文件的简单替代方案(是的,您可以为 Win/Mac/Linux 编译相同的文件),您可以以 neko 为目标生成 .n 文件,然后使用 nekotools 将其转换为 exe 形式。只需输入:

nekotools boot main.n

The CPP target is the youngest in the Haxe world and so still a little rough on the edges; add in more complexity because it depends on external tools to properly work.

Made that premise, try to create a new Haxe/CPP project in FlashDevelop, open the Main class and add a simple trace("hello world!"); line. Hit F5 to start the "compile and run" process.
You'll see in the status bar the message "Build started ..." and you can follow the process looking at the "Output Panel". If your environment is set correctly it will compile the whole project and open a DOS window where it will execute the generated executable (you can find it in the bin folder).

If you receive an error then your environment is not yet ready to build CPP applications with Haxe. To fix that follow the setup instructions you can find here.

An easy alternative to produce native execubles (yes, you can compile the same for Win/Mac/Linux) you can target neko to produce a .n file and nekotools to transform it in the exe form. Just type:

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