如何 运行 在 hdf5 上测试单个函数

How to run a test for a single function on a hdf5

我正在尝试测试 tarray.cpp。我知道你可以使用 cmake,但我需要为一个项目使用 G++。我只需要测试 tarray 部分及其依赖项。我将 tarray 及其所有依赖项放在同一个文件夹中。但是,当我尝试编译它时,出现此错误:

$ g++ tarray.cpp -o tarray

在包含的文件中来自 H5Cpp.h:18:0,来自 tarray.cpp:28:

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

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

我在同一个文件夹里有hdf5,不知道为什么检测不到。

#include <hdf5.h> 更改为 #include "hdf5.h"

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

#include 两边的引号将检查当前目录,而尖括号将检查包含路径。