57

When using doxygen to generate C++ inheritance diagrams, I've noticed that the diagrams can be incomplete.

If several projects are documented using tag files to allow cross-referencing, doxygen will successfully show all base classes that exist in other tag files, but it will not show derived classes if they are in other tag files. The derived classes shown are always only the classes that exist in the current project.

Example project 1 code:

class A {};

class B : public A {};

class C : public A {};

Example project 2 code:

#include <proj1.h>

class D : public A {};

class E : public A {};

class F : public E {};

An inheritance diagram of A from project 1, using a tag file from project 2 - where is D, E & F?

enter image description here

An inheritance diagram of E from project 2, using a tag file from project 1 - parent class A is shown.

enter image description here

Is there a setting to tell doxygen to generate complete inheritance graphs across projects when tag files are used?

8
  • 3
    This could be a doxygen bug. Commented Sep 9, 2016 at 16:32
  • Not sure if it will help you across multiple objects but have you tried Graphviz? Commented Sep 22, 2016 at 6:07
  • @DPD Yes, doxygen is using Graphviz (specifically the tool dot) to generate those graphs, if I understand you correctly. Commented Sep 23, 2016 at 15:19
  • Not sure whether or not this question is of interest, but as far as I can see when setting HAVE_DOT=YES the correct graph is shown. When not setting the HAVE_DOT=YES the D, E and F are missing. Commented Nov 18, 2019 at 18:02
  • 4
    Can you also post your Doxyfile? I was wondering if you use ALLEXTERNALS=YES, or maybe HIDE_UNDOC_RELATIONS=NO or other potentially relevant settings. Commented Sep 7, 2021 at 13:04

1 Answer 1

2

Doxygen does not support showing derived classes from other projects via tag files. While it can resolve base classes from tag files, derived class information is not included because tag files do not contain reverse inheritance data.

There is no setting in Doxygen to generate complete inheritance diagrams across projects when using tag files.

Workarounds:

  1. Merge all relevant source files into a single Doxygen run to allow full inheritance resolution.

  2. Manually document derived classes using \see or comments.

  3. Use external tools (e.g., Graphviz + AST parsers) to generate the diagrams that you are talking about.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.