Missing external HDF5 symbols when linking in Visual Studio 2017

Hello everyone:

I am migrating a console application originally developed in C++ for Unix into Windows x86 (it has not been easy, believe me…). I am using Visual Studio 2017 for the migration. The application makes use of HDF5 libraries for some input and output to files. I followed the instructions outlined here using the Cmake GUI, and I was successful (or so I thought) in generating the HDF5 library files. I added all pertinent paths, directories and files for the compiler and the linker in Visual Studio IDE, and the linker is down to 2 unresolved symbol errors:

  • GetFileInformationByHandle (utilized in function H5FD_sec2_open, file H5FDsec2.c)
  • LoadLibraryExA (a #define clause in file H5PL.c)

I find it very strange that those are the only two unresolved symbols in the whole linking process. Did I miss a fine point during the library building? Can it be an issue with the application using the libraries? If anybody has any idea about what might be going on, I sincerely appreciated it.

Martin

Which version of HDF5 are you trying to build? Have a look at the CMake instructions that come with https://portal.hdfgroup.org/display/support/Download+HDF5. (https://support.hdfgroup.org/ftp/HDF5/current/src/unpacked/release_docs/INSTALL_CMake.txt is no longer maintained. I’m sorry that that’s not clear from the page itself.) G.

I am using 1.10.1. I will give it a try with the newest version and see if that solves the problem.

@m.nieto

If you are using dynamic libraries did you include the proprocessor definition: H5_BUILT_AS_DYNAMIC_LIB