# Unresolved external symbol when using downloaded binary

**URL:** <https://forum.hdfgroup.org/t/unresolved-external-symbol-when-using-downloaded-binary/11772>\
**Category:** HDF5 Library\
**Created:** [November 29, 2023, 3:47pm UTC](https://forum.hdfgroup.org/t/unresolved-external-symbol-when-using-downloaded-binary/11772 "2023-11-29T15:47:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel.porto](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/d/e68b1a/32.png) [@daniel.porto](https://forum.hdfgroup.org/u/daniel.porto)\
**Post date:** [November 29, 2023, 3:47pm UTC](https://forum.hdfgroup.org/t/unresolved-external-symbol-when-using-downloaded-binary/11772/1 "2023-11-29T15:47:00Z")

</div>

Hello,

I am trying to compile code (for saving 3D image data) using HDF5 on Windows 10 with Visual Studio 17.2 (x64).

I downloaded and installed the binary of HDF5 v1.14.3 (x64).

I added the include path and lib path into the corresponding Visual Studio options and specify those 2 lib: hdf5\_cpp.lib hdf5.lib.

I also added the bin path to the “PATH” env variable.

However, I still have an unresolved external symbol for: H5T\_NATIVE\_INT\_g. I have tried various other type\_id’s when creating a dataset, but always get an unresolved external symbol.

Is there something I’m missing for properly using HDF5 in visual studio/c++?

Thanks,

---

<div class="post-metadata">

**Author:** ![byrn](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@byrn](https://forum.hdfgroup.org/u/byrn)\
**Post date:** [November 29, 2023, 4:05pm UTC](https://forum.hdfgroup.org/t/unresolved-external-symbol-when-using-downloaded-binary/11772/2 "2023-11-29T16:05:41Z")

</div>

When using the shared library, be sure to add the define =\> H5\_BUILT\_AS\_DYNAMIC\_LIB  
see the “Using Visual Studio” section in the doxygen “Compiling HDF5 Applications” page.

We do have this in a file in the source "release\_docs/USING\_HDF5\_VS.txt but we should include it in one of the text files of the binary.

---

<div class="post-metadata">

**Author:** ![byrn](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@byrn](https://forum.hdfgroup.org/u/byrn)\
**Post date:** [November 29, 2023, 4:14pm UTC](https://forum.hdfgroup.org/t/unresolved-external-symbol-when-using-downloaded-binary/11772/3 "2023-11-29T16:14:36Z")

</div>

The window binaries should include the USING\_HDF5\_VS.txt file! It is in the NOTE of the first section.

---

<div class="post-metadata">

**Author:** ![daniel.porto](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/d/e68b1a/32.png) [@daniel.porto](https://forum.hdfgroup.org/u/daniel.porto)\
**Post date:** [November 29, 2023, 4:25pm UTC](https://forum.hdfgroup.org/t/unresolved-external-symbol-when-using-downloaded-binary/11772/4 "2023-11-29T16:25:08Z")

</div>

Great, thank you!

To be extra clear for other users that see this post, the solution was to define H5\_BUILT\_AS\_DYNAMIC\_LIB. This is done by going to project Properties-\>Configuration Properties-\>C/C+±\>Preprocessor and adding H5\_BUILT\_AS\_DYNAMIC\_LIB to Preprocessor definitions.

---

<div class="post-metadata">

**Author:** ![byrn](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@byrn](https://forum.hdfgroup.org/u/byrn)\
**Post date:** [December 1, 2023, 4:32pm UTC](https://forum.hdfgroup.org/t/unresolved-external-symbol-when-using-downloaded-binary/11772/5 "2023-12-01T16:32:51Z")

</div>

> [@daniel.porto](#):
>
> This is done by going to project Properties-\>Configuration Properties-\>C/C+±\>Preprocessor and adding H5\_BUILT\_AS\_DYNAMIC\_LIB to Preprocessor definitions.

I have added this to the USING\_HDF5\_VS.txt file in the hdf5 source/release\_docs folder.

---

<div class="post-metadata">

**Author:** ![hana](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/h/b19c9b/32.png) [@hana](https://forum.hdfgroup.org/u/hana)\
**Post date:** [December 11, 2023, 1:01pm UTC](https://forum.hdfgroup.org/t/unresolved-external-symbol-when-using-downloaded-binary/11772/6 "2023-12-11T13:01:45Z")

</div>

Firstly, correct HDF5 version v1.14.3, set accurate library paths, confirm proper library names such as hdf5\_cpp.lib and hdf5.lib, check compiler options for x64 and C++ standard and add HDF5 bin directory to PATH and rebuild your project. Include H5Cpp.h in your code, utilizing the correct namespaces and classes for HDF5.
