gpt4 book ai didi

c - 在 Doxygen 中处理两个同名的不同函数

转载 作者:太空狗 更新时间:2023-10-29 17:24:29 27 4
gpt4 key购买 nike

我有一个 C 项目,其中包含两个同名的函数,但每个都在不同的组/模块 (@defgroup) 中。

这些函数各自编译成不同的二进制文件,但我需要文档紧密交叉引用,所以我需要从每个函数中引用(@ref)这些函数(以及其他地方)其他模块。

当我执行简单的@ref name-of-the-function 时,它总是链接到位于文件树中较早的文件中的那个。我怎样才能链接到另一个?

最佳答案

据我所知:doxygen 的自动链接不支持具有相同名称的多个函数。

如果有多个具有相同名称的函数/方法,doxygen 将简单地链接它找到的第一个,如问题中所述。调用图也不正确。这似乎适用于所有语言,而不仅仅是 C。

这已被多次报告为错误:

本节"Known problems"在doxygen的文档中也描述了类似的问题:

It is not possible to insert a non-member function f in a class A using the \relates or \relatesalso command, if class A already has a member with name f and the same argument list.


有一些希望;有人提出了一个补丁来更好地处理同名函数:#4365 getDefs fails to resolve local function names if same global name exist .

This patch implements the following two strategies for resolving duplicated names. First, is the name is defined in current file, use the local name. Secondly try to match the names using the prototype definition.

这将部分解决问题。不幸的是,这张票自 2012 年以来就没有任何事件......

关于c - 在 Doxygen 中处理两个同名的不同函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9548701/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com