hi i m looking for a good tutrial to include the hdf5 lib in my eclipse cdt toolchain im using mingw32 as compiler and cant find any tutorial which descripes fully how to do it. If i found a link for a tutorial it was anytimes a dead link.
What i did so far:
-download and installed hdf5 with the msi installer and tryed to link it in the project under c/c++ build -> Settings ->Tool Settings tab -> Miscellaneous->other objects and set “path of install folder”\1.13.1\bin\hdf5.dll
didnt worked console output was
C:/Program Files/HDF_Group/HDF5/1.13.1/bin/hdf5.dll: file not recognized: File format not recognized
than i tried to set it in project properties-> C/C++ General-> Paths and Symbols under libraries tab i added hdf5.dll (with full path and without) and also i set the path in Library Path
didnt worked console output
C:/Program Files/HDF_Group/HDF5/1.13.1/bin/hdf5.dll: file not recognized: File format not recognized
than i tried to download the mingw ackage with the pacman from msys this only worked for 64 bit but i need 32 bit
can someone please please help me like i said any link i found to a tutorial is dead or for vs but need it for eclipse
I don’t use Eclipse.
Historically being a Linux guy, I have started to migrate to Windows using MSYS2 / MinGW64.
I am curious to know why you need 32-bit, when chances are your Windows client already is 64-bit.
Sorry to hear you use Eclipse. If you learned how to build from the command line, you would only need to learn one thing, once and for all; with IDE’s, you need to read the docs for that particular IDE.
weil das Programm auf einen 32 bit system laufen muss deshalb geht meines wissens nach 64 bit nicht. Weißt du denn wie ich mit cmds die lib erstellen kann so das ich sie in mein project erstellen einfügen kann salazar?
Don’t let my name mislead you, I am not from Germany and I don’t speak German; I am of Spanish descent and my proper name is Germán (but that accent often does not get included in my e-mail addresses).
ah sorry my mistake so in englisch again i need to do it in 32 bit bc the target system is just 32 bit. i tried to follow this tutorial GitHub - long-gong/HDF5-with-MinGW: Play HDF5 with MinGW on Windows 10 found a error in the cmd:
cmake -G “MinGW Makefiles” -DCMAKE_BUILD_TYPE:STRING=Release -DHDF5_BUILD_FORTRAN:BOOL=OFF -DHDF5_BUILD_JAVA:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=\path\to\install\HDF5 DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON …\hdf5-1.10.5
where a “-” is missing so corrected it is :
cmake -G “MinGW Makefiles” -DCMAKE_BUILD_TYPE:STRING=Release -DHDF5_BUILD_FORTRAN:BOOL=OFF -DHDF5_BUILD_JAVA:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=\path\to\install\HDF5 -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON …\hdf5-1.10.5
than i run mingw-make but this throws lot of error which i put in a txt file and attach it here mingw-make-errors.txt (42.7 KB)
can u maybe check it and help me
I may have time to take a look later.
I am totally new to hdf5, but I just built it for Linux.
Also, I am already setup to use MinGW and GCC on my Windows machine.
We shall see.
Having said, it does not look like A LOT OF ERRORS; most are warnings and notes, there are only 2 errors.
Update: I just realized that you are using cmake…I typically (like never) use cmake.
As a matter of habit, I downloaded the *.tar file for hdf5 to my Windows machine, opened a bash terminal and simply started to do what I always do: ./configure, make, make install…
…it is working, but it is taking forever…I am spoiled by the Linux machines, my Windows machine seems to be about 2 orders of magnitude slower than Linux. I am going to let it be; maybe tomorrow I will try with cmake.
Build Mode: production
Debugging Symbols: no
Asserts: no
Profiling: no
Optimization Level: high
Linking Options:
Libraries: static
Statically Linked Executables:
LDFLAGS:
H5_LDFLAGS:
AM_LDFLAGS:
Extra libraries: -lm
Archiver: ar
AR_FLAGS: cr
Ranlib: ranlib
Languages:
C: yes
C Compiler: /c/mingw/bin/gcc
CPPFLAGS:
H5_CPPFLAGS: -DNDEBUG -UH5_DEBUG_API
AM_CPPFLAGS:
C Flags:
H5 C Flags:
AM C Flags:
Shared C Library: no
Static C Library: yes
Fortran: yes
Fortran Compiler: /c/mingw/bin/gfortran
Fortran Flags:
H5 Fortran Flags:
AM Fortran Flags:
Shared Fortran Library: yes
Static Fortran Library: yes
C++: yes
C++ Compiler: /c/mingw/bin/g++
C++ Flags:
H5 C++ Flags:
AM C++ Flags:
Shared C++ Library: no
Static C++ Library: yes
Java: no
Features:
Parallel HDF5: no
Parallel Filtered Dataset Writes: no
Large Parallel I/O: no
High-level library: yes
Dimension scales w/ new references: no
Build HDF5 Tests: yes
Build HDF5 Tools: yes
Threadsafety: no
Default API mapping: v112
With deprecated public symbols: yes
I/O filters (external):
MPE: no
Map (H5M) API: no
Direct VFD: no
Mirror VFD: no
(Read-Only) S3 VFD: no
(Read-Only) HDFS VFD: no
dmalloc: no
Packages w/ extra debug output: none
API tracing: no
Using memory checker: no
Memory allocation sanity checks: no
Function stack tracing: no
Use file locking: best-effort
Strict file format checks: no
Optimization instrumentation: no
Output:
Making all in src
/usr/bin/sh: line 21: make: command not found
Makefile:723: recipe for target ‘all-recursive’ failed
mingw32-make: *** [all-recursive] Error 1
u dont have to try cmake for me if u say its working without for you maybe we find a way thats working for me to i just want the debugable libs out of it no matter how we did it ty
is ./configure doing config it automaticaly in 32 bit maybe this error are problems between 64 config and 32 bit compiler? If i have to set a flag for 32 bit how i would do this?
ok i found out that at least the strtok_r function is not part of mingw32 but what i can now here just write it by my own or is there a config/complier flag that i have to set?
was able to solve this by setting the strtok_r to strtok but after this more and more function appear which are not in mingw32 did i something wrong here with flags or something else?
I don’t know the answers to all those questions; I wouldn’t know what to do, either, if ./configure, make and make install does not work out of the box.
I will report my troubles a bit later…and I do have troubles, too…the same sources that I built on Linux, are not building on Windows.
I did not get too far in the compilation process, either; the same sources I built in Linux are not building on Windows. Here are the 2 error messages that cause termination:
In file included from H5PLint.c:30:
H5PLint.c: In function 'H5PL__open':
H5PLpkg.h:97:33: warning: implicit declaration of function 'dlopen'; did you mean 'fdopen'? [-Wimplicit-function-declaration]
97 | #define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY | RTLD_LOCAL)
| ^~~~~~
H5PLpkg.h:97:43: error: 'RTLD_LAZY' undeclared (first use in this function)
97 | #define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY | RTLD_LOCAL)
| ^~~~~~~~~
H5PLpkg.h:97:55: error: 'RTLD_LOCAL' undeclared (first use in this function)
97 | #define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY | RTLD_LOCAL)
| ^~~~~~~~~~
That dlopen for mingw does exist; I just installed it in my instance of msys2/mingw64:
pacman -S mingw-w64-x86_64-dlfcn
That this package provides library dl (/mingw64/lib/libdl.a).
Went back to take a look at the output from my initial ./configure and found this:
.
.
checking for dlfcn.h... no # <----- ojo
.
.
checking for ceil in -lm... yes
checking for dlopen in -ldl... no # <----- ojo
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking dirent.h usability... yes
.
.
Started over and re-run ./configure; this time, I get:
checking for dlfcn.h... yes # <----- ojo
.
.
checking for dlopen in -ldl... yes # <----- ojo