Doxygen:在创建数组

时间:2016-08-30 21:45:16

标签: c doxygen doxygen-addtogroup

这个问题是由于doxygen解析约束。我在Kinetis Design Studio中使用带有Eclox(eclipse插件)的doxygen 1.8.11进行嵌入式C开发。

几乎所有的doxygen编译工作,除了我需要一些非常大的静态数组。我不想弄乱主要代码,所以我使用了在这些论坛上发现的黑客(https://stackoverflow.com/a/4645515/6776259):

static const float Large_Array[2000] = {
#include "Comma_Delimited_Text_File.txt"
};

不幸的是,该hack导致我的main.c main_module 组的编译失败。出现以下错误:

警告:组内的文件结尾

我尝试用以下内容从 main_module 组中排除这些常量:

/*!
**  @addtogroup main_module
**  @{
*/
...
... header code ...
...
/*!
** @}
*/
static const float Large_Array[2000] = {
#include "Comma_Delimited_Text_File.txt"
};
/*!
**  @addtogroup main_module
**  @{
*/
...
More code, definitions, etc.
None of this is generated in the doxygen compile...?
/*!
** @}
*/

这消除了doxygen编译错误,但编译后的doxygen文档在Large_Array声明之后不包含任何内容。所以似乎第二个 @addtogroup 语句不起作用。

我错过了一些简单的东西吗?任何帮助表示赞赏。谢谢。

1 个答案:

答案 0 :(得分:1)

If Comma_Delimited_Text_File.txt doesn't have trailing linebreak, then try adding one.

Doxygen gets confused if include file doesn't end with linebreak. This can break the document generation for other files too, even when they don't seem related. Often this results in missing symbols and broken callgraphs.