5

Doxygen has a really neat feature whereby it will generate inheritance graphs from code. However, when using multiple inheritance from classes with a common base, the plot shows two separate base classes (even though I'm using virtual inheritance as signified by the dashed lines around the base class)

enter image description here

How can I make Doxygen plot something more like the following . . .

     D
    / \
   B   C
    \ /
     A

And not: (as happens without virtual inheritance)

     D
   /   \
   B   C
   |   |
   A   A
learnvst
  • 15,455
  • 16
  • 74
  • 121
  • You know, I upvoted and favorited this a long time ago, but the more I think about it, the more I think that doxygen is actually right here, since D will have 2 instances of A. – IdeaHat Sep 15 '14 at 16:49
  • 1
    There will not be 2 instances of A if the inheritance is virtual via `class B : public virtual A {}` – Okkenator Jun 02 '15 at 19:33
  • On Ubuntu 18.04.3, using doxygen/doxywizard 1.8.13, I have the same problem with the "built-in class diagram generator". If I use `dot` (i.e. graphviz (dot) version 2.40.1) to generate the diagrams, then I get a proper diamond, but I lose the shading/dashed-outline signifying that the topmost class has been virtually inherited. Very annoying. – badfd Jan 06 '20 at 17:24

1 Answers1

3

If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is available from the path. This tool is part of Graphviz (see: http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent Bell Labs. The other options in this section have no effect if this option is set to NO The default value is: NO.

Set to

HAVE_DOT = YES

oukore
  • 76
  • 1
  • 5