【问题标题】:How to run a test for a single function on a hdf5如何在 hdf5 上运行单个功能的测试
【发布时间】:2021-03-11 07:34:30
【问题描述】:

我正在尝试测试 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"。尖括号表示在系统目录中搜索,双引号也表示在当前目录中搜索。

标签: c++ hdf5


【解决方案1】:

#include &lt;hdf5.h&gt; 更改为#include "hdf5.h"

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-03-29
    • 2010-09-21
    • 2012-12-29
    • 2015-01-09
    • 1970-01-01
    • 2015-04-09
    • 1970-01-01
    相关资源
    最近更新 更多