# Compile minimal example with MinGW

**URL:** <https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219>\
**Category:** Hdf-forum archives\
**Created:** [May 15, 2014, 1:14pm UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219 "2014-05-15T13:14:26Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![paramon](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@paramon](https://forum.hdfgroup.org/u/paramon)\
**Post date:** [May 15, 2014, 1:14pm UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/1 "2014-05-15T13:14:26Z")

</div>

Hello ladies and gentlemen!

I'm trying to compile a minimal HDF5 example via MinGW on w32:

#include "hdf5.h"

int main()  
{  
&nbsp;&nbsp;&nbsp;hid\_t file\_id;  
&nbsp;&nbsp;&nbsp;hid\_t dataset\_id;  
&nbsp;&nbsp;&nbsp;hid\_t attribute\_id;  
&nbsp;&nbsp;&nbsp;hid\_t space\_id;  
&nbsp;&nbsp;&nbsp;hssize\_t nscans, npeaks;  
&nbsp;&nbsp;&nbsp;double minmz, maxmz;

&nbsp;&nbsp;&nbsp;printf("Opening MS.abf ... ");  
&nbsp;&nbsp;&nbsp;file\_id = H5Fopen("MS.abf", H5F\_ACC\_RDONLY, H5P\_DEFAULT);  
&nbsp;&nbsp;&nbsp;if(file\_id \> 0)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("done.\n");  
&nbsp;&nbsp;&nbsp;else{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("error!\n");  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 1;  
&nbsp;&nbsp;&nbsp;};

&nbsp;&nbsp;&nbsp;dataset\_id = H5Dopen(file\_id, "rettime", H5P\_DEFAULT);  
&nbsp;&nbsp;&nbsp;space\_id = H5Dget\_space(dataset\_id);  
&nbsp;&nbsp;&nbsp;nscans = H5Sget\_simple\_extent\_npoints(space\_id);  
&nbsp;&nbsp;&nbsp;printf("Total scans: %lld.\n", nscans);  
&nbsp;&nbsp;&nbsp;H5Sclose(space\_id);  
&nbsp;&nbsp;&nbsp;H5Dclose(dataset\_id);

&nbsp;&nbsp;&nbsp;dataset\_id = H5Dopen(file\_id, "specdata/mz", H5P\_DEFAULT);  
&nbsp;&nbsp;&nbsp;space\_id = H5Dget\_space(dataset\_id);  
&nbsp;&nbsp;&nbsp;npeaks = H5Sget\_simple\_extent\_npoints(space\_id);  
&nbsp;&nbsp;&nbsp;printf("Total MS peaks: %lld.\n", npeaks);  
&nbsp;&nbsp;&nbsp;H5Sclose(space\_id);

&nbsp;&nbsp;&nbsp;attribute\_id = H5Aopen(dataset\_id, "min", H5P\_DEFAULT);  
&nbsp;&nbsp;&nbsp;H5Aread(attribute\_id, H5T\_NATIVE\_DOUBLE, &minmz);  
&nbsp;&nbsp;&nbsp;H5Sclose(attribute\_id);  
&nbsp;&nbsp;&nbsp;attribute\_id = H5Aopen(dataset\_id, "max", H5P\_DEFAULT);  
&nbsp;&nbsp;&nbsp;H5Aread(attribute\_id, H5T\_NATIVE\_DOUBLE, &maxmz);  
&nbsp;&nbsp;&nbsp;H5Sclose(attribute\_id);  
&nbsp;&nbsp;&nbsp;printf("M/z range: %f..%f.\n", minmz, maxmz);

&nbsp;&nbsp;&nbsp;H5Dclose(dataset\_id);

&nbsp;&nbsp;&nbsp;H5Fclose(file\_id);

&nbsp;&nbsp;&nbsp;return;  
}

I'm running

\>gcc test.c -I"C:\Progra~2\HDF\_Group\HDF5\1.8.12\include" -L"C:\Progra~2\HDF\_Group\HDF5\1.8.12\lib" -lhdf5 -otest.exe

but I get

C:\Users\paramon\AppData\Local\Temp\ccqrZOee.o:test.c:(.text+0x177): undefined reference to `H5T\_NATIVE\_DOUBLE\_g'  
C:\Users\paramon\AppData\Local\Temp\ccqrZOee.o:test.c:(.text+0x1c5): undefined reference to `H5T\_NATIVE\_DOUBLE\_g'  
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: C:\Users\paramon\AppData\Local\Temp\ccqrZOee.o: bad reloc address 0x20 in section `.eh\_frame'  
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation  
collect2.exe: error: ld returned 1 exit status

It seems to be some problem with H5T\_NATIVE\_DOUBLE or, more generally, with DLLVARs. Without them, the program compiles and runs fine.

Does anyone has experience with building HDF5-dependant code on w32? I wish to write a small demo example for my HDF5-based format; I do not have much C experience, so maybe I'm missing something really simple.

Best wishes,  
Andrey Paramonov

> **···**
>
> --  
> This message has been scanned for viruses and  
> dangerous content by MailScanner, and is  
> believed to be clean.

---

<div class="post-metadata">

**Author:** ![werner](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/w/f4b2a3/32.png) [@werner](https://forum.hdfgroup.org/u/werner)\
**Post date:** [May 15, 2014, 3:37pm UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/2 "2014-05-15T15:37:20Z")

</div>

Hi Andrei,

was hdf5\_EXPORTS defined when compiling HDF5?

You could check the hdf5.dll if its appropriately defined for export:

$ nm hdf5.dll | grep H5T\_NATIVE\_DOUBLE  
000000006b60ac80 B H5T\_NATIVE\_DOUBLE\_ALIGN\_g  
000000006b60abf8 B H5T\_NATIVE\_DOUBLE\_COMP\_ALIGN\_g  
000000006b57d6c4 D H5T\_NATIVE\_DOUBLE\_g  
000000006b60ad60 B H5T\_NATIVE\_DOUBLE\_NEG\_INF\_g  
000000006b60ad58 B H5T\_NATIVE\_DOUBLE\_POS\_INF\_g

Werner

> **···**
>
> On 15.05.2014 15:14, Андрей Парамонов wrote:
> 
> > Hello ladies and gentlemen!
> > 
> > I'm trying to compile a minimal HDF5 example via MinGW on w32:
> > 
> > #include "hdf5.h"
> > 
> > int main()  
> > {  
> > hid\_t file\_id;  
> > hid\_t dataset\_id;  
> > hid\_t attribute\_id;  
> > hid\_t space\_id;  
> > hssize\_t nscans, npeaks;  
> > double minmz, maxmz;
> > 
> > printf("Opening MS.abf ... ");  
> > file\_id = H5Fopen("MS.abf", H5F\_ACC\_RDONLY, H5P\_DEFAULT);  
> > if(file\_id \> 0)  
> > printf("done.\n");  
> > else{  
> > printf("error!\n");  
> > return 1;  
> > };
> > 
> > dataset\_id = H5Dopen(file\_id, "rettime", H5P\_DEFAULT);  
> > space\_id = H5Dget\_space(dataset\_id);  
> > nscans = H5Sget\_simple\_extent\_npoints(space\_id);  
> > printf("Total scans: %lld.\n", nscans);  
> > H5Sclose(space\_id);  
> > H5Dclose(dataset\_id);
> > 
> > dataset\_id = H5Dopen(file\_id, "specdata/mz", H5P\_DEFAULT);  
> > space\_id = H5Dget\_space(dataset\_id);  
> > npeaks = H5Sget\_simple\_extent\_npoints(space\_id);  
> > printf("Total MS peaks: %lld.\n", npeaks);  
> > H5Sclose(space\_id);
> > 
> > attribute\_id = H5Aopen(dataset\_id, "min", H5P\_DEFAULT);  
> > H5Aread(attribute\_id, H5T\_NATIVE\_DOUBLE, &minmz);  
> > H5Sclose(attribute\_id);  
> > attribute\_id = H5Aopen(dataset\_id, "max", H5P\_DEFAULT);  
> > H5Aread(attribute\_id, H5T\_NATIVE\_DOUBLE, &maxmz);  
> > H5Sclose(attribute\_id);  
> > printf("M/z range: %f..%f.\n", minmz, maxmz);
> > 
> > H5Dclose(dataset\_id);
> > 
> > H5Fclose(file\_id);
> > 
> > return;  
> > }
> > 
> > I'm running
> > 
> > \>gcc test.c -I"C:\Progra~2\HDF\_Group\HDF5\1.8.12\include" -L"C:\Progra~2\HDF\_Group\HDF5\1.8.12\lib" -lhdf5 -otest.exe
> > 
> > but I get
> > 
> > C:\Users\paramon\AppData\Local\Temp\ccqrZOee.o:test.c:(.text+0x177): undefined reference to `H5T\_NATIVE\_DOUBLE\_g'  
> > C:\Users\paramon\AppData\Local\Temp\ccqrZOee.o:test.c:(.text+0x1c5): undefined reference to `H5T\_NATIVE\_DOUBLE\_g'  
> > c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: C:\Users\paramon\AppData\Local\Temp\ccqrZOee.o: bad reloc address 0x20 in section `.eh\_frame'  
> > c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation  
> > collect2.exe: error: ld returned 1 exit status
> > 
> > It seems to be some problem with H5T\_NATIVE\_DOUBLE or, more generally, with DLLVARs. Without them, the program compiles and runs fine.
> > 
> > Does anyone has experience with building HDF5-dependant code on w32? I wish to write a small demo example for my HDF5-based format; I do not have much C experience, so maybe I'm missing something really simple.
> > 
> > Best wishes,  
> > Andrey Paramonov
> 
> --  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Dr. Werner Benger Visualization Research  
> Center for Computation & Technology at Louisiana State University (CCT/LSU)  
> 2019 Digital Media Center, Baton Rouge, Louisiana 70803  
> Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

---

<div class="post-metadata">

**Author:** ![paramon](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@paramon](https://forum.hdfgroup.org/u/paramon)\
**Post date:** [May 19, 2014, 11:29am UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/3 "2014-05-19T11:29:15Z")

</div>

I turns out that instead of

\>gcc test.c -I"C:\Progra~2\HDF\_Group\HDF5\1.8.12\include" -L"C:\Progra~2\HDF\_Group\HDF5\1.8.12\lib" -lhdf5 -otest.exe

I should have specified

\>gcc test.c -I"C:\Progra~2\HDF\_Group\HDF5\1.8.12\include" -L"C:\Progra~2\HDF\_Group\HDF5\1.8.12\bin" -lhdf5 -otest.exe

Now my program builds and works like a charm!

Thank you for your support,  
Andrey Paramonov

> **···**
>
> --  
> This message has been scanned for viruses and  
> dangerous content by MailScanner, and is  
> believed to be clean.

---

<div class="post-metadata">

**Author:** ![paramon](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@paramon](https://forum.hdfgroup.org/u/paramon)\
**Post date:** [May 16, 2014, 5:40am UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/4 "2014-05-16T05:40:43Z")

</div>

15.05.2014 19:37, Werner Benger пишет:

> Hi Andrei,
> 
> was hdf5\_EXPORTS defined when compiling HDF5?
> 
> You could check the hdf5.dll if its appropriately defined for export:
> 
> $ nm hdf5.dll | grep H5T\_NATIVE\_DOUBLE  
> 000000006b60ac80 B H5T\_NATIVE\_DOUBLE\_ALIGN\_g  
> 000000006b60abf8 B H5T\_NATIVE\_DOUBLE\_COMP\_ALIGN\_g  
> 000000006b57d6c4 D H5T\_NATIVE\_DOUBLE\_g  
> 000000006b60ad60 B H5T\_NATIVE\_DOUBLE\_NEG\_INF\_g  
> 000000006b60ad58 B H5T\_NATIVE\_DOUBLE\_POS\_INF\_g

For official 1.8.12 w32 shared binary, I get

\>nm hdf5.dll | grep H5T\_NATIVE\_DOUBLE  
C:\MinGW\bin\nm.exe: hdf5.dll: no symbols

However, Dependency Walker does list H5T\_NATIVE\_DOUBLE\_g among exported symbols of hdf5.dll.

I wish that my minimal example can be compiled and run only with minimal work (single gcc invocation, no need for cmake etc). Is it possible?

Best wishes,  
Andrey Paramonov

> **···**
>
> --  
> This message has been scanned for viruses and  
> dangerous content by MailScanner, and is  
> believed to be clean.

---

<div class="post-metadata">

**Author:** ![werner](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/w/f4b2a3/32.png) [@werner](https://forum.hdfgroup.org/u/werner)\
**Post date:** [May 16, 2014, 8:15am UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/5 "2014-05-16T08:15:45Z")

</div>

> 15.05.2014 19:37, Werner Benger пишет:
> 
> > Hi Andrei,
> > 
> > was hdf5\_EXPORTS defined when compiling HDF5?
> > 
> > You could check the hdf5.dll if its appropriately defined for export:
> > 
> > $ nm hdf5.dll | grep H5T\_NATIVE\_DOUBLE  
> > 000000006b60ac80 B H5T\_NATIVE\_DOUBLE\_ALIGN\_g  
> > 000000006b60abf8 B H5T\_NATIVE\_DOUBLE\_COMP\_ALIGN\_g  
> > 000000006b57d6c4 D H5T\_NATIVE\_DOUBLE\_g  
> > 000000006b60ad60 B H5T\_NATIVE\_DOUBLE\_NEG\_INF\_g  
> > 000000006b60ad58 B H5T\_NATIVE\_DOUBLE\_POS\_INF\_g
> 
> For official 1.8.12 w32 shared binary, I get
> 
> \>nm hdf5.dll | grep H5T\_NATIVE\_DOUBLE  
> C:\MinGW\bin\nm.exe: hdf5.dll: no symbols

Hm, it seems this HDF5.dll was compiled differently then than mine. There might be a hdf5.dll.a in your version that contains those symbols instead, and in that case you would need to link against that one instead of the .dll .

> However, Dependency Walker does list H5T\_NATIVE\_DOUBLE\_g among exported symbols of hdf5.dll.
> 
> I wish that my minimal example can be compiled and run only with minimal work (single gcc invocation, no need for cmake etc). Is it possible?

I am not using cmake myself, neither the official HDF5 configure/makefile (they seem to have some issue under mingw, it might be trivial, but couldn't identify it yet). I can share you my makefiles if you're interested.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Werner

> **···**
>
> On 16.05.2014 07:40, Андрей Парамонов wrote:
> 
> --  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Dr. Werner Benger Visualization Research  
> Center for Computation & Technology at Louisiana State University (CCT/LSU)  
> 2019 Digital Media Center, Baton Rouge, Louisiana 70803  
> Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

---

<div class="post-metadata">

**Author:** ![paramon](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@paramon](https://forum.hdfgroup.org/u/paramon)\
**Post date:** [May 16, 2014, 8:24am UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/6 "2014-05-16T08:24:16Z")

</div>

16.05.2014 12:15, Werner Benger пишет:

> Hm, it seems this HDF5.dll was compiled differently then than mine.  
> There might be a hdf5.dll.a in your version that contains those symbols  
> instead, and in that case you would need to link against that one  
> instead of the .dll .

But the hdf5.dll from official binaries \*does\* contain those symbols! I can see the from Dependency Walker, and I can import and use them from Delphi code (but for the latter, I had to create a huge wrapper which I want to avoid for my minimal C example).

> I am not using cmake myself, neither the official HDF5  
> configure/makefile (they seem to have some issue under mingw, it might  
> be trivial, but couldn't identify it yet). I can share you my makefiles  
> if you're interested.

In fact, I'd like to avoid makefiles also 😉 It seems strange that for such a minimal example one couldn't just invoke gcc directly.

Could you please share your HDF5 binaries?

Best wishes,  
Andrey Paramonov

> **···**
>
> --  
> This message has been scanned for viruses and  
> dangerous content by MailScanner, and is  
> believed to be clean.

---

<div class="post-metadata">

**Author:** ![werner](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/w/f4b2a3/32.png) [@werner](https://forum.hdfgroup.org/u/werner)\
**Post date:** [May 16, 2014, 10:11am UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/7 "2014-05-16T10:11:44Z")

</div>

Hi Andrey,

&nbsp;&nbsp;seems my hdf5.dll is 144MB in size, so I would need to put in on some webserver to download, my email doesn't like to send such large files. Note that it's not the newest 1.8.13 but an older version, and it's compiled with mingw64. Do you really want it? I could also compile a 32bit binary as well, but I think I would need to re-install mingw 32 bit, which otherwise I don't use any more.

And yes, you could compile HDF5 also without a makefile. Mostly it's just compiling all .c files to .o, plus two special cases for H5detect and H5libsettings, which need to built as binary first and then generate some source from this. I have these rules in my own makefile for convenience, but it could also be done manually.

Poka,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Werner

> **···**
>
> On 16.05.2014 10:24, Андрей Парамонов wrote:
> 
> > 16.05.2014 12:15, Werner Benger пишет:
> > 
> > > Hm, it seems this HDF5.dll was compiled differently then than mine.  
> > > There might be a hdf5.dll.a in your version that contains those symbols  
> > > instead, and in that case you would need to link against that one  
> > > instead of the .dll .
> > 
> > But the hdf5.dll from official binaries \*does\* contain those symbols! I can see the from Dependency Walker, and I can import and use them from Delphi code (but for the latter, I had to create a huge wrapper which I want to avoid for my minimal C example).
> > 
> > > I am not using cmake myself, neither the official HDF5  
> > > configure/makefile (they seem to have some issue under mingw, it might  
> > > be trivial, but couldn't identify it yet). I can share you my makefiles  
> > > if you're interested.
> > 
> > In fact, I'd like to avoid makefiles also 😉 It seems strange that for such a minimal example one couldn't just invoke gcc directly.
> > 
> > Could you please share your HDF5 binaries?
> > 
> > Best wishes,  
> > Andrey Paramonov
> 
> --  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Dr. Werner Benger Visualization Research  
> Center for Computation & Technology at Louisiana State University (CCT/LSU)  
> 2019 Digital Media Center, Baton Rouge, Louisiana 70803  
> Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

---

<div class="post-metadata">

**Author:** ![paramon](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@paramon](https://forum.hdfgroup.org/u/paramon)\
**Post date:** [May 16, 2014, 10:21am UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/8 "2014-05-16T10:21:59Z")

</div>

16.05.2014 14:11, Werner Benger пишет:

> Hi Andrey,
> 
> &nbsp;&nbsp;seems my hdf5.dll is 144MB in size, so I would need to put in on some  
> webserver to download, my email doesn't like to send such large files.  
> Note that it's not the newest 1.8.13 but an older version, and it's  
> compiled with mingw64. Do you really want it?

Maybe it is possible that I go the other way around? I can download static version of HDF5 binaries from official website, and try to compile my example using it. Do you know the magic spell I should input in command line to do so?

I do not want to recompile HDF5 library because it seems non-trivial, and because I hardly believe it can change anything compared to official binaries...

Best wishes,  
Andrey Paramonov

> **···**
>
> --  
> This message has been scanned for viruses and  
> dangerous content by MailScanner, and is  
> believed to be clean.

---

<div class="post-metadata">

**Author:** ![werner](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/w/f4b2a3/32.png) [@werner](https://forum.hdfgroup.org/u/werner)\
**Post date:** [May 16, 2014, 10:45am UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/9 "2014-05-16T10:45:46Z")

</div>

> 16.05.2014 14:11, Werner Benger пишет:
> 
> > Hi Andrey,
> > 
> > &nbsp;&nbsp;seems my hdf5.dll is 144MB in size, so I would need to put in on some  
> > webserver to download, my email doesn't like to send such large files.  
> > Note that it's not the newest 1.8.13 but an older version, and it's  
> > compiled with mingw64. Do you really want it?
> 
> Maybe it is possible that I go the other way around? I can download static version of HDF5 binaries from official website, and try to compile my example using it. Do you know the magic spell I should input in command line to do so?

The official HDF5 binaries are compiled with Visual Studio, not MinGW, as far as I know. While it is C and can be linked with each other, it may need some additional work to extract those symbols from the dll to a .a file that is needed for mingw to link. It's possible, there are some instructions out there on how to make MinGW dll/.a from an existing DLL. There are tools like [MinGW-w64 - for 32 and 64 bit Windows download | SourceForge.net](http://sourceforge.net/apps/trac/mingw-w64/wiki/gendef) which help extracting such symbols and making them gcc-compatible, but in my experience that's all effortsome and it's just easier to compile HDF5 with mingw itself.

> I do not want to recompile HDF5 library because it seems non-trivial, and because I hardly believe it can change anything compared to official binaries...

I find it rather easy and do it frequently, just not using cmake or the official configure script, which has issues under msys/mingw. I can share those makefiles, but I'd need to prepare them to work standalone for just HDF5, usually I use them as part of a larger application.

There are difference to the official binaries because mingw can put symbols into the DLL's itself, while for MSVC-compiled binaries such symbols are usually provided as external .def files if they are not part of the DLL. I'm not experienced with MS Visual Studio so don't know too well those options, but there are differences beside all basic compatibilies.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Werner

> **···**
>
> On 16.05.2014 12:21, Андрей Парамонов wrote:
> 
> --  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Dr. Werner Benger Visualization Research  
> Center for Computation & Technology at Louisiana State University (CCT/LSU)  
> 2019 Digital Media Center, Baton Rouge, Louisiana 70803  
> Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

---

<div class="post-metadata">

**Author:** ![paramon](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@paramon](https://forum.hdfgroup.org/u/paramon)\
**Post date:** [May 16, 2014, 10:46am UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/10 "2014-05-16T10:46:55Z")

</div>

16.05.2014 14:45, Werner Benger пишет:

> **···**
>
> > On 16.05.2014 12:21, Андрей Парамонов wrote:
> > 
> > > I do not want to recompile HDF5 library because it seems non-trivial,  
> > > and because I hardly believe it can change anything compared to  
> > > official binaries...
> > 
> > I find it rather easy and do it frequently, just not using cmake or the  
> > official configure script, which has issues under msys/mingw. I can  
> > share those makefiles, but I'd need to prepare them to work standalone  
> > for just HDF5, usually I use them as part of a larger application.
> 
> It would be great if you could share the makefiles, and some instructions for how to cast those on official tarball 😉
> 
> Best wishes,  
> Andrey Paramonov
> 
> --  
> This message has been scanned for viruses and  
> dangerous content by MailScanner, and is  
> believed to be clean.

---

<div class="post-metadata">

**Author:** ![werner](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/w/f4b2a3/32.png) [@werner](https://forum.hdfgroup.org/u/werner)\
**Post date:** [May 16, 2014, 11:04am UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/11 "2014-05-16T11:04:07Z")

</div>

Will do. Working on making them standalone for just HDF5 and will let you know as soon as it's ready.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Werner

> **···**
>
> On 16.05.2014 12:46, Андрей Парамонов wrote:
> 
> > 16.05.2014 14:45, Werner Benger пишет:
> > 
> > > On 16.05.2014 12:21, Андрей Парамонов wrote:
> > > 
> > > > I do not want to recompile HDF5 library because it seems non-trivial,  
> > > > and because I hardly believe it can change anything compared to  
> > > > official binaries...
> > > 
> > > I find it rather easy and do it frequently, just not using cmake or the  
> > > official configure script, which has issues under msys/mingw. I can  
> > > share those makefiles, but I'd need to prepare them to work standalone  
> > > for just HDF5, usually I use them as part of a larger application.
> > 
> > It would be great if you could share the makefiles, and some instructions for how to cast those on official tarball 😉
> 
> --  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Dr. Werner Benger Visualization Research  
> Center for Computation & Technology at Louisiana State University (CCT/LSU)  
> 2019 Digital Media Center, Baton Rouge, Louisiana 70803  
> Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

---

<div class="post-metadata">

**Author:** ![werner](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/w/f4b2a3/32.png) [@werner](https://forum.hdfgroup.org/u/werner)\
**Post date:** [May 16, 2014, 11:38am UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/12 "2014-05-16T11:38:17Z")

</div>

Here, use this URL for SVN checkout:

&nbsp;&nbsp;&nbsp;&nbsp;[https://subversion.assembla.com/svn/FiberHDF5/hdf5](https://subversion.assembla.com/svn/FiberHDF5/hdf5)

I just verified it to work under both Linux and MinGW64.

Once checked out, just do a make in the hdf5/ subdir, in Windows/Msys use mingw32-make .

Msys make should work as well, but I didn't test it, mingw32-make is much faster.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Werner

> **···**
>
> On 16.05.2014 13:04, Werner Benger wrote:
> 
> > On 16.05.2014 12:46, Андрей Парамонов wrote:
> > 
> > > 16.05.2014 14:45, Werner Benger пишет:
> > > 
> > > > On 16.05.2014 12:21, Андрей Парамонов wrote:
> > > > 
> > > > > I do not want to recompile HDF5 library because it seems non-trivial,  
> > > > > and because I hardly believe it can change anything compared to  
> > > > > official binaries...
> > > > 
> > > > I find it rather easy and do it frequently, just not using cmake or the  
> > > > official configure script, which has issues under msys/mingw. I can  
> > > > share those makefiles, but I'd need to prepare them to work standalone  
> > > > for just HDF5, usually I use them as part of a larger application.
> > > 
> > > It would be great if you could share the makefiles, and some instructions for how to cast those on official tarball 😉
> > 
> > Will do. Working on making them standalone for just HDF5 and will let you know as soon as it's ready.
> 
> --  
> &nbsp;&nbsp;\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Dr. Werner Benger Visualization Research  
> Center for Computation & Technology at Louisiana State University (CCT/LSU)  
> 2019 Digital Media Center, Baton Rouge, Louisiana 70803  
> Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

---

<div class="post-metadata">

**Author:** ![paramon](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@paramon](https://forum.hdfgroup.org/u/paramon)\
**Post date:** [May 16, 2014, 12:15pm UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/13 "2014-05-16T12:15:49Z")

</div>

16.05.2014 15:38, Werner Benger пишет:

> > > 16.05.2014 14:45, Werner Benger пишет:
> > > 
> > > > > I do not want to recompile HDF5 library because it seems non-trivial,  
> > > > > and because I hardly believe it can change anything compared to  
> > > > > official binaries...
> > > > 
> > > > I find it rather easy and do it frequently, just not using cmake or the  
> > > > official configure script, which has issues under msys/mingw. I can  
> > > > share those makefiles, but I'd need to prepare them to work standalone  
> > > > for just HDF5, usually I use them as part of a larger application.
> > > 
> > > It would be great if you could share the makefiles, and some  
> > > instructions for how to cast those on official tarball 😉
> > 
> > Will do. Working on making them standalone for just HDF5 and will let  
> > you know as soon as it's ready.
> 
> Here, use this URL for SVN checkout:
> 
> &nbsp;&nbsp;&nbsp;&nbsp;[https://subversion.assembla.com/svn/FiberHDF5/hdf5](https://subversion.assembla.com/svn/FiberHDF5/hdf5)
> 
> I just verified it to work under both Linux and MinGW64.
> 
> Once checked out, just do a make in the hdf5/ subdir, in Windows/Msys  
> use mingw32-make .

Thank you!

I have checked out GNUmakefile.rules into Makefile my example program dir (is it correct?). How do I run mingw32-make?

Best wishes,  
Andrey Paramonov

> **···**
>
> > On 16.05.2014 13:04, Werner Benger wrote:
> > 
> > > On 16.05.2014 12:46, Андрей Парамонов wrote:
> > > 
> > > > > On 16.05.2014 12:21, Андрей Парамонов wrote:
> 
> --  
> This message has been scanned for viruses and  
> dangerous content by MailScanner, and is  
> believed to be clean.

---

<div class="post-metadata">

**Author:** ![werner](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/w/f4b2a3/32.png) [@werner](https://forum.hdfgroup.org/u/werner)\
**Post date:** [May 16, 2014, 5:11pm UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/14 "2014-05-16T17:11:38Z")

</div>

By doing

&nbsp;&nbsp;&nbsp;&nbsp;svn checkout [https://subversion.assembla.com/svn/FiberHDF5/hdf5](https://subversion.assembla.com/svn/FiberHDF5/hdf5)

You would get those two files plus three subdirectories

&nbsp;&nbsp;&nbsp;&nbsp;hdf5/  
&nbsp;&nbsp;&nbsp;&nbsp;make/  
&nbsp;&nbsp;&nbsp;&nbsp;zlib123/

These are included via SVN externals. Then you just cd into this main directory and type "mingw32-make". It should traverse into the zlib123/ folder first and then hdf5/ , finally printing a message that it's all done.

mingw32-make is usually included with a mingw installation. Are you using msys and bash as command prompt?

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Werner

> **···**
>
> On 16.05.2014 14:15, Андрей Парамонов wrote:
> 
> > 16.05.2014 15:38, Werner Benger пишет:
> > 
> > > On 16.05.2014 13:04, Werner Benger wrote:
> > > 
> > > > On 16.05.2014 12:46, Андрей Парамонов wrote:
> > > > 
> > > > > 16.05.2014 14:45, Werner Benger пишет:
> > > > > 
> > > > > > On 16.05.2014 12:21, Андрей Парамонов wrote:
> > > > > > 
> > > > > > > I do not want to recompile HDF5 library because it seems non-trivial,  
> > > > > > > and because I hardly believe it can change anything compared to  
> > > > > > > official binaries...
> > > > > > 
> > > > > > I find it rather easy and do it frequently, just not using cmake or the  
> > > > > > official configure script, which has issues under msys/mingw. I can  
> > > > > > share those makefiles, but I'd need to prepare them to work standalone  
> > > > > > for just HDF5, usually I use them as part of a larger application.
> > > > > 
> > > > > It would be great if you could share the makefiles, and some  
> > > > > instructions for how to cast those on official tarball 😉
> > > > 
> > > > Will do. Working on making them standalone for just HDF5 and will let  
> > > > you know as soon as it's ready.
> > > 
> > > Here, use this URL for SVN checkout:
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;[https://subversion.assembla.com/svn/FiberHDF5/hdf5](https://subversion.assembla.com/svn/FiberHDF5/hdf5)
> > > 
> > > I just verified it to work under both Linux and MinGW64.
> > > 
> > > Once checked out, just do a make in the hdf5/ subdir, in Windows/Msys  
> > > use mingw32-make .
> > 
> > Thank you!
> > 
> > I have checked out GNUmakefile.rules into Makefile my example program dir (is it correct?). How do I run mingw32-make?
> 
> --  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Dr. Werner Benger Visualization Research  
> Center for Computation & Technology at Louisiana State University (CCT/LSU)  
> 2019 Digital Media Center, Baton Rouge, Louisiana 70803  
> Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

---

<div class="post-metadata">

**Author:** ![werner](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/w/f4b2a3/32.png) [@werner](https://forum.hdfgroup.org/u/werner)\
**Post date:** [May 17, 2014, 3:24pm UTC](https://forum.hdfgroup.org/t/compile-minimal-example-with-mingw/3219/15 "2014-05-17T15:24:10Z")

</div>

Just to follow up, you would do just the following on the command line using bash:

&nbsp;&nbsp;&nbsp;svn checkout [https://subversion.assembla.com/svn/FiberHDF5/hdf5](https://subversion.assembla.com/svn/FiberHDF5/hdf5)  
&nbsp;&nbsp;&nbsp;cd hdf5  
&nbsp;&nbsp;&nbsp;mingw32-make

Provided "svn", "mingw32-make" and gcc (both a 64-bit gcc and 32-bit gcc will work) are in your PATH. The file hdf5.dll will be placed together with zlib in a subfolder of the newly created lib/ directory.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Werner

> **···**
>
> On 16.05.2014 19:11, Werner Benger wrote:
> 
> > On 16.05.2014 14:15, Андрей Парамонов wrote:
> > 
> > > 16.05.2014 15:38, Werner Benger пишет:
> > > 
> > > > On 16.05.2014 13:04, Werner Benger wrote:
> > > > 
> > > > > On 16.05.2014 12:46, Андрей Парамонов wrote:
> > > > > 
> > > > > > 16.05.2014 14:45, Werner Benger пишет:
> > > > > > 
> > > > > > > On 16.05.2014 12:21, Андрей Парамонов wrote:
> > > > > > > 
> > > > > > > > I do not want to recompile HDF5 library because it seems non-trivial,  
> > > > > > > > and because I hardly believe it can change anything compared to  
> > > > > > > > official binaries...
> > > > > > > 
> > > > > > > I find it rather easy and do it frequently, just not using cmake or the  
> > > > > > > official configure script, which has issues under msys/mingw. I can  
> > > > > > > share those makefiles, but I'd need to prepare them to work standalone  
> > > > > > > for just HDF5, usually I use them as part of a larger application.
> > > > > > 
> > > > > > It would be great if you could share the makefiles, and some  
> > > > > > instructions for how to cast those on official tarball 😉
> > > > > 
> > > > > Will do. Working on making them standalone for just HDF5 and will let  
> > > > > you know as soon as it's ready.
> > > > 
> > > > Here, use this URL for SVN checkout:
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;[https://subversion.assembla.com/svn/FiberHDF5/hdf5](https://subversion.assembla.com/svn/FiberHDF5/hdf5)
> > > > 
> > > > I just verified it to work under both Linux and MinGW64.
> > > > 
> > > > Once checked out, just do a make in the hdf5/ subdir, in Windows/Msys  
> > > > use mingw32-make .
> > > 
> > > Thank you!
> > > 
> > > I have checked out GNUmakefile.rules into Makefile my example program dir (is it correct?). How do I run mingw32-make?
> 
> --  
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Dr. Werner Benger Visualization Research  
> Center for Computation & Technology at Louisiana State University (CCT/LSU)  
> 2019 Digital Media Center, Baton Rouge, Louisiana 70803  
> Tel.: +1 225 578 4809 Fax.: +1 225 578-5362
