0

I am trying to test tarray.cpp. I know you can use cmake, but I need to use G++ for a project. I just need to test the tarray portion and its dependencies. I put the tarray and all its dependencies in the same folder. However, when I try to compile it, I get this error:

$ g++ tarray.cpp -o tarray

In file included from H5Cpp.h:18:0, from tarray.cpp:28:

H5Include.h:15:10: fatal error: hdf5.h: No such file or directory

#include <hdf5.h>
          ^~~~~~~~
compilation terminated.

I have the hdf5 in the same folder, so I do not know why it does not detect it.

mvp
  • 111,019
  • 13
  • 122
  • 148
  • Try `#include "hdf5.h"`. Angle brackets mean search in system directories, and double quotes mean search in current directory too. – mvp Nov 28 '20 at 23:59

1 Answers1

1

Change #include <hdf5.h> to #include "hdf5.h".

See What is the difference between #include and #include “filename”?.

The quotes around the #include will check in the current directory, while the angle brackets will check the include path.

blackbrandt
  • 2,010
  • 1
  • 15
  • 32