Is it possible to statically link the standard hxcpp dlls?

I don’t really like having many files next to the exe file, so I want to statically link them. I am using openfl with the legacy mode on because otherwise sampledataevent doesn’t seem to work for windows target. But judging from the past posts here, you can’t static link when it’s legacy… or is it just about the lime ndll and I can still static link other dlls somehow? If so, I would love to know how!

There is a static build possible for windows, I’m not sure if that’s legacy or next though.

What happens if you do lime build windows -clean -static -Dlegacy? (the use of -clean is important, otherwise the ndlls already there wouldn’t be removed)

An important note: there’s no sound support for static builds, the “normal” ones use openAL which is licensed under the lgpl, so to avoid making your game open source (gpl) it’s disabled on static.

Thanks for the quick reply but it’s actually too quick I am still not home! I was expecting it gets answered
by the time I am home. Definitely try it as your post as soon as I am home.

Is it possible to dynamic link lime and static link other dlls( such as std, regexp) so I can still get openAL to work then? An exe file with one dll would be very clean and I would love that.

(updated my previous post, forgot the legacy flag)

Well at the very least it should be technically possible, though there’s nothing for that in the tools right now.

I guess -static could become a meta flag which activate something like -D static_std and -D static_lime. To be researched.

I did “lime build windows -clean -static -Dlegacy” on the HelloWorld sample and got

Warning: Could not find template file: cpp/static
Export/windows/cpp/haxe/ApplicationMain.hx:3: characters 7-16 : Class not found
: lime.Lime

Looks like I can’t use “-static” and “-Dlegacy” at the same time after all? Without using -Dlegacy I could get one single HelloWorld.exe (also icon.ico and manifest) that seems to work fine. (though it still gave me some kind of error messages like the following).

Primitive not found : lime_byte_array_init__4
Primitive not found : lime_byte_array_get_native_pointer__1
Primitive not found : lime_byte_array_overwrite_file__2
Primitive not found : lime_byte_array_read_file__1

-static- is not currently supported for -Dlegacy, but if someone wanted to help, it could probably be supported