What is compiler flag when outputing to windows platform?

I tried something like this, but it doesn’t seem to work.

#if hxcpp
  var shape:Shape = new Shape();
#end

And it isn’t listed here.

What’s the flag when I target windows? If there isn’t one, what should I do?

Not sure to understand. Haxe doesn’t export for a specific plateform, but for a specific language like cpp or javascript.
You can have a look on OpenFL, Kha, or Heaps. This frameworks can target many plateforms.

http://www.openfl.org
http://kha.tech/

I’m not sure you can detect windows specifically without adding something yourself, but you can check all current defines with haxe.macro.Context.getDefines(); you may find something there.

1 Like

Try this:

#if cpp
    var shape:Shape = new Shape();
#end