简体   繁体   English

Haxe编译的代码无法运行

[英]Haxe compiled code doesn't run

I'm having trouble getting executables compiled from Haxe source to work on computers that don't have Haxe installed. 我无法从Haxe源代码编译可执行文件以在未安装Haxe的计算机上工作。 The problem first appeared with a simple networking program but it seems to come up for any program at all. 这个问题最初是通过一个简单的网络程序出现的,但是似乎根本没有任何程序出现。 Even something like 甚至像

class Test
{
    static function main()
    {
        trace("test");
    }
}

compiled to an exe with haxe -main Test.hx -neko Test.n and nekotools boot Test.n will run on my computer but on anything else gives a neko.dll is missing from your computer error. 使用haxe -main Test.hx -neko Test.nnekotools boot Test.n编译为exe的nekotools boot Test.n将在我的计算机上运行,​​但在其他任何情况下, neko.dll is missing from your computer错误neko.dll is missing from your computer I get a similar error if I compile the haxe source to c++ or c# and run the generated exe. 如果将haxe源编译为c ++或c#并运行生成的exe,则会收到类似的错误。

I'm not sure what neko.dll is, but I don't see how it should be required for the exe to run. 我不确定neko.dll是什么,但是我看不到要运行exe应该怎么需要它。 I feel like I must have some basic misconception! 我觉得我必须有一些基本的误解! Is this intended behavior? 这是预期的行为吗? How can I compile Haxe code so that it will run on any windows machine without installing neko? 如何编译Haxe代码,使其无需安装neko即可在任何Windows计算机上运行?

neko.dll is normally located at C:\\HaxeToolkit\\neko . neko.dll通常位于C:\\ HaxeToolkit \\ neko You may just copy and paste that next to the exe. 您可以将其复制并粘贴到exe旁边。

Generally when distributing a exe, you have to also distribute the required dlls. 通常,在分发exe时,还必须分发所需的dll。 You can check the dll dependency with various tools . 您可以使用各种工具检查dll依赖性。 For example, using Dependency Walker , open the exe by it and it will list out the dlls. 例如,使用Dependency Walker ,通过它打开exe,它将列出dll。 Right click a dll item in its menu and select properties, there you will find where it locates. 右键单击其菜单中的dll项,然后选择属性,即可在其中找到其位置。

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

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