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
- Confirmed that
hdf5_cpp.lib
exists and is being linked. - Dumped symbols from
hdf5_cpp.lib
, butC_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