compiling hdf5 with mingw-cross-compiler - runtime error in win64

Hi everyone,

I've been successfully building hdf5 1.8.10 on the mingw-cross-compiler
[1] .
In order to have a 64-bit version, I've been using the multi-target
repository [2]
and changed the target from "i686-pc-mingw32" to "x86_64-static-mingw32"

Moreover, I've added a runtime test in src/ and src/hdf5-test.c
(see attached files).

[2] GitHub - tonytheodore/mxe: MXE (M cross environment)

diff --git a/Makefile b/Makefile
index cd22bd9..2b2dd13 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
# See index.html for further information.

JOBS := 1
-MXE_TARGETS := i686-pc-mingw32
+MXE_TARGETS := x86_64-static-mingw32

Hdf5 builds without error, but when running the application and using
one of the hdf5 library functions, I get runtime
errors. When running the compiled hdf5-test.exe on win64, I get the attached
error log.

It seems, that some data types get confused. I'm suspecting the patch
because the patch generates two files
which appear to be specifically generated for "Host system:
i686-pc-mingw32". And H5T_NATIVE_LONG and H5T_NATIVE_ULONG are only 4
byte types, which should be 8 bytes on 64bit.

The question is, does anybody now how
should be defined for 64 bit windows target ?

Alois (1.48 KB)

hdf5-test.c (2.25 KB)

error.log (57.3 KB)