Search code examples
c++doxygenmultiple-inheritancevirtual-inheritancediamond-problem

How to make Doxygen show diamond inheritance graphs


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

Solution

  • 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