Paste function link into another file with Doxygen?

I have two source C files. The comment on the bar() function in file A must refer to the foo() function in file B How can I make this link?

I tried:

  • Having written something like: Bc::foo() , hoping that doxygen will go to file B and find the function foo .

  • Also tried just ::foo() , but that didn't help.

  • Then I tried to provide the Bc file with a special tag, as when executing //! @file specialtag //! @file specialtag in the first line of Bc , and then do specialtag::foo() in my comment, but not much has changed.

  • I tried to link the link to \ref and \link , but even that didn't help.

String //! @file //! @file present in both Ac and Bc , so doxygen must know the code.

EDIT

I tried what @doxygen suggested, but no luck. I made an example project to show where I ran into problems, its here: http://www.filedropper.com/testdoxygen2tar

I used the default installation file made with doxygen -g . The result that I get: Firefox showing the page generated by doxygen

You can see that the foobar function is not related to.

EDIT 2

Found a problem. The foo function was undocumented, and therefore no page was created for it, so of course doxygen did not have a link for the link. (I created the documentation with the SOURCE_BROWSER option SOURCE_BROWSER and hoped that a link to the function definition would be created)

+6
source share
1 answer

It is pretty simple. Here is a minimal example that works with the default configuration file ( doxygen -g ):

First create a foo.c file with the following contents:

 /** @file */ /** Function foo, see also bar(). */ void foo() { } 

then create a bar.c file 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 another function.

+5
source

Source: https://habr.com/ru/post/981116/


All Articles