Unresolved External Symbol H5::PredType::C_S1 in HDF5 C++ on Windows 11 (VS2022)

Problem Summary

I am encountering a linker error in Visual Studio 2022 on Windows 11 when trying to use H5::PredType::C_S1 in the HDF5 C++ API. The same project works fine on a different machine running Windows 10 with VS2017 and HDF5 1.10.6.

Error Message

unresolved external symbol "public: static class H5::PredType const & const H5::PredType::C_S1" 
(?C_S1@PredType@H5@@2AEBV12@EB) referenced in function ...

System & Configuration

  • OS: Windows 11
  • Compiler: Visual Studio 2022 (v143)
  • HDF5 Version: Precompiled HDF5 1.10.6 (also tried latest HDF5 1.14.x)
  • Libraries Linked:
hdf5_cpp.lib
hdf5_hl.lib
hdf5.lib
  • Runtime Library Setting: /MD (Multi-threaded DLL)

What I Have Tried

  1. Confirmed that hdf5_cpp.lib exists and is being linked.
  2. Dumped symbols from hdf5_cpp.lib, but C_S1 is missing:
dumpbin /symbols "C:\path\to\HDF5\lib\hdf5_cpp.lib" | findstr "C_S1"

β†’ No output.
3. Checked H5PredType.h – C_S1 is declared in headers but is missing from hdf5_cpp.lib.
4. Tried switching to H5::PredType::NATIVE_CHAR – same linker error.
5. Tried linking /WHOLEARCHIVE:hdf5_cpp.lib to force symbol inclusion – same error.
6. Switched the platform toolset from v143 (VS2022) to v141 (VS2017) – no change.
7. Installed HDF5 1.10.6 (same as working project on VS2017, Windows 10) – same error.
8. Verified that hdf5_cpp.dll is present in PATH at runtime.

Questions for the HDF5 Community

  • Has anyone successfully linked HDF5 C++ in VS2022 on Windows 11?
  • Could this be an ABI issue between VS2017 and VS2022?
  • Is there an HDF5 precompiled binary that is known to work with VS2022?
  • Any known workarounds for missing PredType symbols?

Any help would be appreciated


NOTE: Building applications with the dynamic/shared hdf5 libraries requires
      that the "H5_BUILT_AS_DYNAMIC_LIB" compile definition be used.
      Go to "Project" and select "Properties", find "Configuration Properties",
      and then "C/C++"and then "Preprocessor".
      Add H5_BUILT_AS_DYNAMIC_LIB to Preprocessor definitions.

from hdf5/release_docs/USING_HDF5_VS.txt at develop Β· HDFGroup/hdf5

I don’t know how I missed this! Thank you very much, this solved the problem.

1 Like