I’m trying to link HDF5 in Visual Studio 2015, but keep getting external symbol errors. An example of one error is:
error LNK2019: unresolved external symbol H5LIB_mp_H5OPEN_F reference in function MAIN__
There are 12 errors overall, all with ‘mp’ in the name and most with ‘_F’ at the end.
From basic googling, it seems like the issue may be to do with the way hdf5 was installed and whether the correct compilers were used. The program I’m working on uses the Intel Fortran compilers. I compiled hdf5 from the CMake-hdf5-1.8.19, following the steps outlined on the ‘Building with CMake’ website (this is on a Windows machine). The full text of the batch file is:
CMake will unless told otherwise use the fortran compiler Visual Studio is configured to use. So the “Is it plugged in” question is; what happens when you open the created solution file in Visual Studio and build.
Visual Studio should be configured to use the Intel compilers. When I open the Solution file and build, it compiles, but I cannot tell from the output which compiler it is using.
If a compiler mismatch is not the issue, do you know what else would cause these external symbol errors? I’m at a loss.
I’m using a mix of C and Fortran code. I noticed in another thread that someone had a similar issue and mentioned using a ‘-standard-semantics’ flag. Could this be the issue?
If so, how would I include this on the Cmake build?
However, the problem with the link error is that usually it indicates a missing library or import/export setting.
The way to solve this, is to use VS2015 and open the created solution file in the build folder.
Find the first link issue and inspect the properties in Visual Studio.
There must be a link line issue - maybe compare one of the fortran examples to your project.
Also, Look at the examples project that are available from within the binaries, the source release download, or the HDF repository.