【问题标题】:Why doesn't doxygen find my files为什么 doxygen 找不到我的文件
【发布时间】:2018-02-14 23:23:56
【问题描述】:

我有一个巨大的代码,它的文档是用 doxygen 生成的。

在我的 doxygen 配置文件中有

INPUT                  = ../../src/Fibers \
                         ../../src/SolveursContact/solverAC2
##                       plus some other path
RECURSIVE              = YES

EXCLUDE 标记排除了一些目录,但不包括那些对这个问题很重要的目录。

然后,当我运行 doxygen 时,我收到以下警告(不完整列表)

path/to/src/Fibers/Rendering/Hair/Rendering/Scattering/model.h:4: warning: include file math.h not found, perhaps you forgot to add its directory to INCLUDE_PATH?
path/to/src/Fibers/Rendering/Hair/Rendering/Scattering/model.h:5: warning: include file iostream not found, perhaps you forgot to add its directory to INCLUDE_PATH?
path/to/src/Fibers/Simulation/Configuration.hpp:205: warning: include file ConfigurationParams.def.h not found, perhaps you forgot to add its directory to INCLUDE_PATH?
path/to/src/Fibers/Simulation/SolverManager.cpp:315: warning: include file AC2MecheSolvers.def.h not found, perhaps you forgot to add its directory to INCLUDE_PATH?

(我的路很长,但都是正确的。)

第一点是我显然不希望 doxygen 包含 math.hiostream 的任何文档,而其他一些文件包括 iostream 而没有此警告。那么为什么我会在这里出现这个警告呢?

第二点,我的文件ConfigurationParams.def.hAC2MecheSolvers.def.h 实际上是在某个时候被 doxygen 找到的,因为我已经检查了每个文件的 html 文档页面。那么为什么他们没有在这里链接呢?

我的问题文件的路径是

path/to/src/SolveursContact/solverAC2/src/AC2MecheSolvers.def.h
path/to/src/Fibers/Parameters/ConfigurationParams.def.h

模型.h

1  #ifndef MODEL_MECHE_H
2  #define MODEL_MECHE_H
3
4  #include <math.h>
5  #include <iostream>

配置.hpp

200  #define EXPAND_CONF_PRMWO(n, t, d) \
201      t n ;
202  #define EXPAND_CONF_PARAM(n, t, I, d) \
203      t n ;\
204      t n##SI ;
205  #include "ConfigurationParams.def.h"

SolverManager.cpp

310  #ifdef SOLVER_AC2
311  #define EXPAND_MECHE_SOLVER(n, g, l) \
312      case Configuration::SOLVER_FUNC_##g##_##l : \
313                            res = ac2Solver->solve(g, (LocalSolver) l) ; \
314      break ;
315  #include "AC2MecheSolvers.def.h"

编辑: Doxygen 版本是 1.8.11。

【问题讨论】:

  • doxygen 的哪个版本?您是否在开头看到有关 Parsing file .... path/to/src/Fibers/Parameters/ConfigurationParams.def.h 的内容?这只发生在具有双扩展名 (.def.h) 的文件上吗?您是否排除/不包含在 FILE_PATTERNS 中?
  • @albert 这不仅发生在双扩展文件中,也发生在 math.h 和 iostream 中。对于我的文件,它只发生在这两个文件中,这确实是唯一一个具有双扩展名的文件。这些文件包含在文件模式中,因为所有标题都是 (*.h),但不是 *.def.h。问题是,生成了这两个文件的文档页面,我有相应的 html 页面。
  • 我认为您可以通过使用 INCLUDE_PATH 设置摆脱关于 iostream an math.h 的评论。我认为 *.def.h 文件可能也是如此。另请查看当前版本 (1.8.13) 会发生什么。
  • 这解决了我的 *.def.h 文件的问题,但没有解决 cmath 和 iostream 的问题。 Doxygen 然后尝试为 cmath 和 iostream 生成一些文档。无论如何,这是一个小问题,我有一些更紧急的事情,所以我会考虑一下。非常感谢您的帮助。

标签: doxygen


【解决方案1】:

当从命名空间中包含标准标头时,我遇到了这个问题(使用 doxygen 1.8.14):

namespace ns {
#include <iostream>
// more stuff
}

这也可能间接发生:

// header file
#include <iostream>
// implementation file
namespace ns {
#include "header.h"
// more stuff
}

解决方案当然是在任何命名空间之外包含标准标头。

【讨论】:

  • @DarkZero 将标准标头包含在任何命名空间之外。
  • 感谢您的评论。我用你的解决方案解决了同样的问题:)
猜你喜欢
  • 1970-01-01
  • 2023-03-31
  • 1970-01-01
  • 2018-02-17
  • 2013-07-11
  • 2017-10-23
  • 1970-01-01
  • 2016-12-15
  • 2020-10-01
相关资源
最近更新 更多