I have to provide a software running in Windows compiled with mingw for Win 7 x86_64.
Following some instructions [1], I got a static version of the libraries cross-compiled in a Linux box. Afterwords I moved the libraries to the Win 7 x86_64. I have compiled the c examples without much trouble and check that the generated h5 files are correct. However when I try to do the same with a simple c++ example (create.cpp [2]) I get many errors, see for example:
This is the linking command:
g++ -o tst create.cpp -I./build_win64/include -L./build_win64/lib" -lhdf5_cpp -lhdf5
Type of errors:
1. Multiple definitions:
C:\Users\Jose\Documents\HDF5\TEST\build_win64\lib/libhdf5_cpp.a(H5Exception.o):H5Exception.cpp:(.data$_ZTIN2H59ExceptionE[_ZTIN2H59ExceptionE]+0x0): multiple definition of `typeinfo for H5::Exception'
C:\Users\Jose\AppData\Local\Temp\cctPJEaw.o:1.cpp:(.rdata$_ZTIN2H59ExceptionE[_ZTIN2H59ExceptionE]+0x0): first defined here
2. Cannot get section contents:
C:\Users\Jose\Documents\HDF5\TEST\build_win64\lib/libhdf5_cpp.a(H5Exception.o):H5Exception.cpp:(.data$_ZTIN2H520IdComponentExceptionE[_ZTIN2H520IdComponentExceptionE]+0xffffffffe8bf0040): Cannot get section contents - auto-import exception
3. A final ld error:
c:/mingw-builds/x64-4.8.1-win32-seh-rev5/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Jose\AppData\Local\Temp\cctPJEaw.o: bad reloc address 0x0 in section `.data'
collect2.exe: error: ld returned 1 exit status
Any help would be welcome. Perhaps I am missing some flags either at cross-compiling the libraries in linux or compiling and linking in Win 7.
Jose.
[1] Works for versions 1.8.8 to 1.81.8.10-patch1. For 1.8.12 doesn't work.
http://www.beneaththewaves.net/Software/DaVincis_Shadow_Build_Process_-_Cross-Compiling_For_Windows_on_Linux.html
[2]http://www.hdfgroup.org/ftp/HDF5/current/src/unpacked/c++/examples/create.cpp