I am trying to build an R package (www.r-project.org) for working with
hdf5. I have had no problems doing this on unix, but windows is
problematic. First, the R project uses MinGW to build on windows -- it
doesn't support building with VC. I have successfully built hdf5 using
MinGW on windows, but I am incapable of linking against the hdf5.a and
hdf5_hl.a built with MinGW. I see no way to build a dll (as in the
prebuilt hdf5 libraries downloadable from the website).
Following this thread,
I then downloaded the prebuilt windows version for 32 bit windows. I
compile against it, yielding an error for a repeated definition of
ssize_t (apparently MinGW has this defined as well) in H5Public.h
I comment this out (lineno 118 in H5Public.h in include):
//typedef int ssize_t;
It then compiles. However, then when I link against it, as follows,
PKG_LIBS = -Lc:/rwork/hdf5_prebuilt/hdf5lib/dll -l hdf5dll -l hdf5_hldll
I get a linker error:
undefined reference to _imp_H5T_C_S1_g
Indeed, when I use nm (in the dll directory)
nm hdf5dll.dll | grep H5T_C_S1
I get no results; However, on hdf5.lib (in the lib directory)
nm hdf5.lib | grep H5T_C_S1
0000000 R ??_C@_08LPEJMKOH@H5T_C_S1?$AA@
Naturally, I have tried to link against the .libs in the lib directory
but there is an inherent incompatibility here and it finds no symbols
(probably a Visual C / MinGW incompatibility?)
So my questions are:
1.) Why cannot I link against the .a files of the version of hdf5 which
I build using MinGW?
2.) How can I build .dll files like the prebuilt version does when I
build using MinGW?
3.) How is it possible that H5T_C_S1 is not defined in the .dll?
This code runs out of the box on linux. Nothing special with the
compilers. Thanks very much in advance, any help would be greatly
I hope to make this generally available to the statistics community, but
a pre-requisite is to get the thing working on Windows.
thanks again, jim