Search code examples
dllhaxeneko

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. 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. I get a similar error if I compile the haxe source to c++ or c# and run the generated exe.

I'm not sure what neko.dll is, but I don't see how it should be required for the exe to run. 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?


Solution

  • neko.dll is normally located at C:\HaxeToolkit\neko. You may just copy and paste that next to the exe.

    Generally when distributing a exe, you have to also distribute the required dlls. You can check the dll dependency with various tools. For example, using Dependency Walker, open the exe by it and it will list out the dlls. Right click a dll item in its menu and select properties, there you will find where it locates.