Hi, I previously was successful in building HDF v1.8 from the git repository as a static library using CMake, but I need to build it as a shared DLL (and in Windows x64) and I'm having problems. I'm getting a bunch of linker errors like: cannot open file '..\bin\Debug\hdf5_D.lib' and indeed there are no .libs. I've checked BUILD_SHARED_LIBS in CMake.
In the list archives I found this by John Biddiscombe on Nov/19/2009: === BEGIN QUOTE === Had to work on something else this morning, but the dynamic lib building was broken for win32, so I have made a couple of changes. Just FYI This works fine for setting the export dll flags in the hdf5 dll SET_PROPERTY(TARGET hdf5 APPEND PROPERTY COMPILE_DEFINITIONS _HDF5_HLDLL_EXPORTS_) But you also need to add _HDF5USEDLL_ to every target that links against it - which includes those outside of the project to force dll import status, the easiest way is simply to skip the target properties and add the stuff below to the config.cmake.in The "BUILD_SHARED_LIBS" is replaced by H5_xxx in configure and "hdf5_EXPORTS" is set by cmake for the library itself, and for all other projects we get the use dll alternative if build shared is set. (I know Mike already know this stuff, but maybe the others are interested - incidentally, if cmakeification messages are cluttering the list up undesirably, then please say and we'll keep cmake related stuff to ourselves unless we need clarification of anything). #cmakedefine BUILD_SHARED_LIBS #if defined(H5_BUILD_SHARED_LIBS) # if defined (hdf5_EXPORTS) # define _HDF5DLL_ # else # define _HDF5USEDLL_ # endif #endif == END QUOTE == However, I can't find a config.cmake.in file and if I just create one it doesn't seem to help. -John _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
