Reputation: 3071
I have two C source files. A comment to a function bar()
in file A
needs to refer to a function foo()
in file B
. How can I make this link?
I tried:
Writing something like: B.c::foo()
hoping that doxygen would go to file B
and find function foo
there.
Also tried simply ::foo()
but that did not help.
Then I tried giving file B.c
a special tagname as in doing //! @file specialtag
on first line of B.c
and then doing specialtag::foo()
in my comment but not much has changed.
I tried to force the link with \ref
and \link
but even that did not help.
The //! @file
line is present in both A.c
and B.c
so doxygen should be aware of the code.
EDIT
I tried what @doxygen suggested but with no luck. I made an example project to show where I am running into problems, its here: http://www.filedropper.com/testdoxygen2tar
I used the default setup file, made with doxygen -g
.
The output I am getting:
You can see that the foobar function is not being linked to.
EDIT 2
Found the problem. Function foo
was undocumented and so no page for it was generated, so of course doxygen had no page to link to. (I was generating documentation with the SOURCE_BROWSER
option enabled and hoping that a link to function definition would be generated)
Upvotes: 13
Views: 27195
Reputation: 14879
This is pretty straightforward. Here's a minimal example that works with a default configuration file (doxygen -g
):
First create file foo.c with the following contents:
/** @file */
/** Function foo, see also bar(). */
void foo()
{
}
then create file bar.c with the following contents:
/** @file */
/** Function bar, see also foo(). */
void bar()
{
}
Run doxygen and observe in the HTML output that both functions will have a link to the other function.
Upvotes: 11