really glad to have found this community, hope I’ll find some help.
I’m trying so hard to compile the HDF5 Library via CMake but I’ve come up short.
I’ve downloaded libaec and zlib and built those via CMake GUI (CMAKE_MSVC_RUNTIME_LIBRARY = MultiThreadedDebug).
I wasn’t able to link libaec at first since I’m using MSVC and had to force HIDE_VISIBILITY = 0 and C_STANDARD 11.
Still I’m not sure about what SZIP libraries I’ve to link in the CMake GUI since I have sz.lib, aec.lib, aec-static.lib, etc.
I was able to configure and generate a solution (.sln) to compile via VS 17 2022 but ended up in LINK2019 errors related to _imp_SZ_Encoded and _imp_BuffToBuff methods.
Thanks a ton in advance, any help would be really appreciated!
compiled ZLIB adding CMAKE_MSVC_RUNTIME_LIBRARY = MultiThreadedDebug directly in the CMake GUI
compiled libaec first forcing C11 on MSVC, then setting HAVE_VISIBILITY OFF. Also, hardcoded PATHS to search for libraries in the cmake_config file. Finally set MultiThreadedDebug as above.
lastly compiled HDF5 by first telling CMake to use the static libraries for both ZLIB and libaec (there are variables named HDF5_USE_ZLIB_STATIC and HDF5_USE_SZIP_STATIC). Remember to link aec-static.lib against libaec_LIBRARY and szip_static.lib against SZIP_LIBRARY.
Finally set MultiThreadedDebug as above.
I’ve now run into an issue linked to __imp_StrStrIA and I’m completely lost.
There shouldn’t be any _imp whatsoever having statically compiled everything…any idea?
hdf5 needs the windows library “shlwapi”, see ConfigureChecks.cmake file;
if (WINDOWS)
CHECK_INCLUDE_FILE_CONCAT ("shlwapi.h" ${HDF_PREFIX}_HAVE_SHLWAPI_H)
# Checking for StrStrIA in the library is not reliable for mingw32 to stdcall
set (LINK_PUB_LIBS ${LINK_PUB_LIBS} "shlwapi")
endif ()