Compiling for Windows XP


I’m trying to resurrect and improve an old program of mine which I want to run on one Windows XP system. If I’m asking here, it means that I’m failing.

Here is a minimal Hello World program which also do nothing on my XP box. Any idea what I could check or try?

The program

let () = print_endline "Hello"

The associated dune file:

(executable (name hw))

On the development system, the opam switch is ocaml-variants.4.10.0+beta1+mingw32.

It runs successfully, being started from cygwin or from cmd on the Windows 7 development system.

It seems the generated file has the right format:

$ file hw.exe
hw.exe: PE32 executable (console) Intel 80386, for MS Windows

I do not understand why it is not working on the XP system?

Any hint?

Oh! It seems to work with 4.02.3+mingw32c switch…

Mmm. I’m going to check if my real program is compiling with this version. And I’ll have to bissect in order to find out the first version with which it stopped working in order to understand the reason…

The program is dynamically linked against various dlls (advapi32.dll, msvcrt.dll,…) and depend on an ABI that is only supported by the dlls shipped with Windows Vista or later.
These incompatibilities were introduced by recent changes in the C toolchain (i686-w64-mingw32-gcc and related tools) and the OCaml toolchain itself.

You have to use an older OCaml version and you might need to install an older version of i686-w64-mingw32-gcc (via ).

Thanks for your explanation and links.

Don’t you think that the line 48 in should be adapted, then?

Best regards