These suggestions are for Visual Studio users.
Instructions for building and testing HDF5 applications using CMake can be found in the USING_HDF5_CMake.md file found in this folder.
NOTE: Building applications with the dynamic/shared HDF5 libraries requires that the
H5_BUILT_AS_DYNAMIC_LIBcompile definition be used. Go to "Project" and select "Properties", find "Configuration Properties", and then "C/C++"and then "Preprocessor". AddH5_BUILT_AS_DYNAMIC_LIBto Preprocessor definitions.
The following two sections are helpful if you do not use CMake to build your applications.
Set up path for external libraries and headers. The path settings will need to be in the project property sheets per project. Go to "Project" and select "Properties", find "Configuration Properties", and then "VC++ Directories".
If you are building on 64-bit Windows, find the "Platform" dropdown and select "x64". Add the header path to the "Include Directories" setting. Add the library path to the "Library Directories" setting.
Select Linker->Input and beginning with the "Additional Dependencies" line,
enter the library names. The external libraries should be listed first, followed
by the HDF5 library, and then optionally the HDF5 High Level, Fortran or C++
libraries. For example, to compile a C++ application, enter: hdf5.lib hdf5_cpp.lib.
For static linking:
- HDF5 libraries:
libhdf5.lib libhdf5_cpp.lib - Compression libraries:
libszaec.lib libaec.lib libzlib.lib - System libraries:
shlwapi.lib
Set up the path for external libraries and headers. Invoke Microsoft Visual Studio and go to "Tools" and select "Options", find "Projects", and then "VC++ Directories".
If you are building on 64-bit Windows, find the "Platform" dropdown
and select "x64". Find the box "Show directories for", choose "Include files", add the
header path (i.e. c:\Program Files\HDF_Group\HDF5\2.0.x\include)
to the included directories.
Find the box "Show directories for", choose "Library files", add the
library path (i.e. c:\Program Files\HDF_Group\HDF5\2.0.x\lib)
to the library directories.
If using Fortran libraries, you will also need to setup the path for the Intel Fortran compiler.
Select Project->Properties->Linker->Input and beginning with the
"Additional Dependencies" line, enter the library names. The
external libraries should be listed first, followed by the HDF5
library, and then optionally the HDF5 High Level, Fortran or C++
libraries. For example, to compile a C++ application, enter:
hdf5.lib hdf5_cpp.lib.
For static linking:
- HDF5 libraries:
libhdf5.lib libhdf5_cpp.lib - Compression libraries:
libszaec.lib libaec.lib libzlib.lib - System libraries:
shlwapi.lib
A community support forum is available; please see: https://forum.hdfgroup.org/c/hdf5/8.
Or send email to help@hdfgroup.org for further assistance.