How to implement new Haxe target?


Hi all,

Trying to set up my Haxe build environment, I’m running into some problems (not helped by the fact that I don’t necessarily know what I’m doing in every step)…

Before I share what I’ve done, as well as what’s failing:
I am using Windows 10, I would prefer using this if possible.
Alternatively, I could install any Linux flavour in a VirtualBox instance, if that works better.

So, here goes…

Steps according to


No problems there.


No problems here.


  • Installing dependencies: Windows (Cygwin): Run the Cygwin setup-x86_64.exe against the Cygwin installation directory

I run this, it comes up with:

  • Choose A Download Source; the option selected by default is “Install from Local Directory”. Is this correct? I don’t know what it means…

Okay, I leave it as-is, click Next.

  • Root Directory: C:\OCaml64; probably correct, as this is where OCaml is actually installed. Having said that: I don’t know how OCaml and CygWin interact.
  • Install for: All Users.

Again I leave everything as-is, click Next.

  • Local Package Directory: C:\Users(my user name)\AppData\Local\Temp\cygwin.

No idea. Correct? Probably, hopefully.

I leave as-is, click Next.
It does stuff, then comes up with CygWin Setup – Select Packages (a GUI).
When I change View to Full, there’s a substantial list of packages, and all are “Keep”. I take it this means they’re all installed?

But when I go through the list as mentioned on the Haxe page, not everything is there!

  • make: ok

  • git: ok

  • zlib-devel: NOT THERE. There is a zlib0. Is that it?

  • libpcre-devel: NOT THERE There is a libpcre1. Is that it?

  • mingw64-x86_64-gcc-core: ok

  • mingw64-x86_64-zlib: NOT THERE, and there’s nothing that looks like it.

  • mingw64-x86_64-pcre: NOT THERE, and there’s nothing that looks like it.


  • Copy zlib1.dll and libpcre-1.dll from path/to/cygwin/usr/x86_64-w64-mingw32/sys-root/mingw/bin to the checked out Haxe source directory.

NOPE: C:\OCaml64\usr\x86_64-w64-mingw32\sys-root\mingw\bin does NOT contain said DLLs…


Sooooo… Something’s not quite right.

Where to go from here?


I’ll have a go at


Again, I am not following.
It is perfectly possible that I am just too stupid for this…

If I have ONLY this downloaded, and I run config.bat, nothing happens.
Do I need to have the haxe sources checked out as well, or does this tool do this?

I’m sorry, my questions are probably very stupid.
I need VERY clear and unambiguous instructions…


Any help very, very, very much appreciated…

(Adrian V) #25

getting ocaml running on windows is always APIA as I remember. Maybe it helps to follow the INSTALL steps of the appveyor.yml


Many thanks!
But… bloody hell…
Why is it so difficult to get all this working?!?
Not sure I’m going to pursue this any further…

(Dan Korostelev) #27

yeah, getting ocaml dev environment working on windows is a pain, especially for the first time, sorry :slight_smile:

(Simon Krajewski) #28

It’s the Dark Souls of development setups.


Is there no way to encapsulate all this pain into a lovely (awesome free installer with very capable scripting facility)

installer, somehow?

In the meantime, I’ll keep on trying to get stuff working…
Just wanna start working on my target!

(Mark) #30




(Rudy Ges) #31

I think you misspelled linux.

(Adrian V) #32

if you follow the appveyor.yml script it is not that bad :slight_smile:
here is what I did:

  • install chcoco and git
  • create a source directory for haxe e.g. c:\source
  • open a cmd shell and git clone
  • don’ forget to ‘git submodule update --init --recursive’
  • setup your environment and follow thw appveyor script
set CYG_ROOT=c:\cygwin64
set ARCH=64
set APPVEYOR_BUILD_FOLDER=C:\source\haxe
choco install curl wget -y
curl -fsSL -o cygwin-setup.exe --retry 3
cygwin-setup.exe -g -q -R "%CYG_ROOT%" -P make -P git -P zlib-devel -P mingw64-x86_64-zlib -P mingw64-i686-zlib -P rsync -P patch -P diffutils -P curl -P unzip -P m4 -P perl -P mingw64-x86_64-gcc-core -P mingw64-i686-gcc-core -P libpcre-devel -P mingw64-x86_64-pcre -P mingw64-i686-pcre
curl -fsSL -o "opam.tar.xz" --retry 3
7z x "opam.tar.xz" -so | 7z x -aoa -si -ttar
%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && bash opam${ARCH}/"
%CYG_ROOT%/bin/bash -lc "opam init mingw \"\" --comp 4.07.0+mingw${ARCH}c --switch 4.07.0+mingw${ARCH}c --auto-setup --yes"'
%CYG_ROOT%/bin/bash -lc "opam update --yes"
%CYG_ROOT%/bin/bash -lc "opam pin add haxe \"$APPVEYOR_BUILD_FOLDER\" --no-action --yes"
%CYG_ROOT%/bin/bash -lc "opam install haxe --deps-only --yes"
  • now build haxe for the first time
%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && make -s -f libs && make -j -s -f haxe && make -s -f haxelib"

hope this helps

(Allan Dowdeswell) #33

This totally hits home with me, I feel your pain. Must be an open-source thing.


Hahaha :smile::smile::smile:

P.S. I did mention willingness to eventually install Linux in a VirtualBox instance.
But this is only as a last resort.
I WANT it to work on Windows.

(Valentin Lemière) #35

Did you use the version from the release

If so yes running config.bat should be enough to setup everything and then you can go and build haxe.


opam64/ line 50: readlink: command not found ?


Trying this now, thanks


Build.exe fails with “Cygwin not found”…


Does it need to be in the path or something?


Error : Process creation failure : dumpbin.exe

The file dumpbin.exe doesn’t exist on my system.

Do I need to install the full VS for this (I sure hope not…)?