Users may wish to link to the static runtime library on Windows to avoid linker errors and incompatibilities with other libraries. Linking to the static runtime library means the runtime is linked into the final exe.
Make the following changes to the source code before building:
- Edit the ./<HDF source>/config/cmake/UserMacros/Windows_MT.cmake file:
Set the correct options as needed (/MTd, /MT,..)
Turn BUILD_STATIC_CRT_LIBS on:
option (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" ON)
- Edit the ./<HDF source>/UserMacros.cmake file to add the include line as shown at the top of the Window_MT.cmake file (and add the correct path):