unresolved external symbol H5T_IEEE_F32BE_g


TL;DR: My link step finds most symbols, but none of these built-in type definitions (eg H5T_IEEE_F32BE_g)

Windows 10
HDF5 1.10.2
VC 2017, using command line

cl /LD /I"C:\Program Files\HDF_Group\HDF5\1.10.2\include" myhdf5.c "C:\Program Files\HDF_Group\HDF5\1.10.2\lib\hdf5.lib" /Femyhdf5.dll

myhdf5.obj : error LNK2019: unresolved external symbol H5T_IEEE_F32BE_g referenced in function create_dataset

I found [Windows: unresolved symbol _H5T_STD_I32LE_g] and added the define just before the include, but this did not solve the problem.

#define _HDF5USEDLL_
#include "hdf5.h"

Thanks in advance for any advice!



I believe you are trying to link dynamically, and this define is superseded:
#define HDF5USEDLL

Installing the binary should provide you with the “USING_HDF5_VS.txt” file in the "C:\Program Files\HDF_Group\HDF5\1.10.2\share folder. There should be the following text in the top section:

NOTE: Building applications with the dynamic/shared hdf5 libraries requires
that the “H5_BUILT_AS_DYNAMIC_LIB” compile definition be used.