Console window on cpp target

I was getting an irritating console window when using the neko target on Windows 7 so I thought I’d have a go at targeting cpp instead. I installed TDM-GCC-64 and set the MINGW_ROOT environment variable to point at it, then output my HelloWorld project using the command:

openfl build cpp

but I’m still getting a console window :confused:

What am I doing wrong?

The command is openfl build windows.
Not sure what “build cpp” do.

[quote=“ibilon, post:2, topic:1257, full:true”]
The command is openfl build windows.
[/quote]Oops :blush:

[quote=“ibilon, post:2, topic:1257, full:true”]
Not sure what “build cpp” do.
[/quote]Exactly the same as it turns out, I guess the cpp target must be the default at the end of a switch statement?

Having looked at stackoverflow I think I need to pass a -mwindows flag to the mingw linker in order to get rid of the console window.
How do I do that?

OK, I’ve got rid of the console window and this is how I did it (I don’t know if there’s a better way):

Open the file C:\HaxeToolkit\haxe\lib\hxcpp\3,2,81\toolchain\mingw-toolchain.xml

Find the section that starts with:
linker id=“exe” exe=“g++”

and alter this line:
flag value="-Wl,–enable-auto-import"

to this:
flag value="-Wl,–enable-auto-import,-subsystem,windows"

Perhaps we could use something like MSVC toolchain in HXCPP:

<set name="SUBSYSTEMWINDOWS" value="1" if="no_console" unless="HXCPP_DEBUGGER" />
<set name="SUBSYSTEMCONSOLE" value="1" unless="SUBSYSTEMWINDOWS" />

If we do something similar for the Mingw toolchain, then OpenFL should already pass the correct define in order to use the Windows subsystem