I'm trying to compile the following (main.cpp):
#include "H5Cpp.h"
using namespace H5;
int main (void)
{
H5File file("test.h5", H5F_ACC_TRUNC);
}
The H5File constructor used here has the following signature:
H5File(const char* name, unsigned int flags, const FileCreatPropList&
create_plist = FileCreatPropList::DEFAULT, const FileAccPropList&
access_plist = FileAccPropList::DEFAULT);
...so it as two additional default parameters. I get undefined
reference when the linker is trying to resolve those:
main.obj : error LNK2019: unresolved external symbol "public: static
class H5::FileAccPropList const & const H5::FileAccPropList::DEFAULT"
(?DEFAULT@FileAccPropList@H5@@2ABV12@B) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: static
class H5::FileCreatPropList const & const
H5::FileCreatPropList::DEFAULT"
(?DEFAULT@FileCreatPropList@H5@@2ABV12@B) referenced in function
I'm using QtCreator since I'm going to use the library in a Qt
application. The .pro file for QtCreator is as follows:
TARGET = hdf5_test
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += "C:/Program Files (x86)/HDF_Group/HDF5/1.8.16/include"
LIBS += -L"C:/Program Files (x86)/HDF_Group/HDF5/1.8.16/lib/" -lhdf5 -lhdf5_cpp
- I'm linking against the shared library version
- I have no preprocessor directives defined
- I'm using the contents of this installer: HDF5-1.8.16-win32.msi
Can someone provide me with a working C++ example for this latest library?
Since I'm not using CMake, what is useful for me in an example is:
code, include path, library path, preprocessor defines and possibly
compiler switcher.
Is one option to use the static versions instead? If so how can I
debug my application if only release builds are available? (Cannot mix
release and debug binaries).