How to install and use doxygen

原创 2006年05月19日 16:43:00

How to install and use doxygen


OS         : Redhat Fedora 2

Doxygen    : 1.3.6


Doxygen is a very famous tool to generate automatically detailed documentation in the light of commentary of source codes. It supports C++, C, Java, IDL(Corba, Microsoft, and KDE-DECOP flavors) and to some extent PHP and C#. If you are familiar with Java, it is equivalent to javadoc tool which is a documentation system for java. It can help you in three ways:

1. It can generate an on-line documentation browser(in HTML) and/or an off-line reference manual(in LATEX) from a set of documented source files. There is also support for generating output in RTF(MS word), Postscript, hyperlinked PDF, compressed HTML, and Unix man pages. The documentation is extracted directly from the sources, which makes it much easier to keep the documentation consistent with the source code.

2. You can configure doxygen to extract the code structure from undocumented source files. The is very useful to quickly find your way in large source distributions. You can also visualize the relations between the various elements by means of include dependency graphs, inheritance diagrams and collaboration diagrams, which are all generated automatically.

3.    You can even ‘abuse’ doxygen to create normal documentation.


[Essential tools]

flex        : GNU fast lexical analyzer generator

bison       : GNU project parser generator(yacc replacement)



Qt           : GUI toolkit, please visit relative contents in my blog website.

latex        : An famous MACRO package tool


ghostscript  : PDF language interpreter and previewer


[How to install]

There are two ways to install doxygen. First one makes full use of binary file of doxygen. Compared with the second, it is easier. So the following contents focus on how to install doxygen by source codes.

To be supposed that you have obtained source codes of doxygen. If readers don’t know where to download them, please visit

1. Copy file into proper directory and unpack the archive

#tar xvzf ./doxygen-$VERSION.src.tar.gz

2. Run configure script

#cd doxygen-$VERSION


Script will automatically search relative platform and tools. If essential tools have not been found, error information will be shown and you must install them before installing doxygen. Of course, users can customize how to configure it. For example, ‘—platform’ (#./configure  --platform platform-type) can been utilized when users want to change platform. If Qt tool has existed, ‘--with-doxywizard’(#./configure --with-doxywizard) may be deployed to build GUI-front end. For an overview of other configuration options, please use ‘#./configure --help‘ to get it.

3. Compile doxygen. After finished compiling, doxygen, doxytag and doxysearch will be produced


4. Generate user manual

#make docs

#make pdf

‘make docs’ generates HTML format’s user manual, and pdf format’s user manual is created by the ‘make pdf’ commandJ.

5. Install doxygen

#make install

Binaries will be installed into <prefix>/bin directory, and <docdir>/doxygen directory stores documentations and examples. Users can use ‘./configure –prefix or --docdir’ to change locations, and the default <dordir> directory is <prefix>/share/doc/packages.


[Doxygen information flow]

Doxygen is a key tache that connects with doxytag and doxysearch. It will parse source codes and read external doxygen documentations to generate or update doxygen documentations in the light of customized format. It can be concluded from figure 1 that doxygen is main program and doxytag is only needed if users want to generate to external documentations (i.e. documentation that was generated by doxygen) for which users do not have the sources or to create a search index for the search engine. Moreover, doxysearch will take an important role in the search engine. From the figure 1, users can easily find that doxywizard provides GUI to edit configuration file of doxygen, and it is a friend tool to manage doxygen later.

Figure 1 Doxygen Information Flow


[Doxygen description style]

Doxygen has two kinds of description style, which combine with a documentation: a brief description and detailed description. However, they are optional. The following contents will focus on these two types of description.


Detailed description


1. If readers are familiar with Java, this style is coherent with javadoc.


 * detailed description


2. The style of Qt has been adopted in doxygen.


 * detailed description


3. The above intermediate stars are optional, so you can do like this:

/**                                  /*!

  Detailed description     or      detailed description

*/                                   */

4. Use commentary of C++’s style besides an additional slash or exclamation will be followed.

///                                      //!

/// detailed description     or     //! Detailed description

///                                      //!



/// detailed description



Brief description


1. Use/brief command and detailed description will be followed after an empty line.

/*! /brief Brief description

 *           continuing brief description


 * detailed description


2. JAVADOC_AUTOBRIEF is set to YES in the configuration file, using JavaDoc style comment blocks will automatically start a brief description which wends at the first dot followed by a space or new line.

For C or C++

/** Brief description.             /** Brief description. Detailed

 * detailed description      or     *  description

 */                                     */

For C++

/// Brief description.               /// Brief description. Detailed

/// detailed description      or   /// description

///                                     ///

3. Otherwise, JAVADOC_AUTOBRIEF is set to NO and use C++ style

/// Brief description

/** detailed description */



//! Brief description


//! Detailed description

Furthermore, if there is one brief description before a declaration and one before a definition of a code item, only the one before the declaration will be used. If the same situation occurs for a detailed description, the one before the definition is preferred and the one before the declaration will be ignored.


[Doxygen commands]

Sometimes programmers want to place commentary before namespace, class, function, variables, etc. Doxygen supports these operations. However, the payment is that programmers must use structural command started with a backslash (/) or an at-sign (@) which is followed by doxygen command and one or more parameters.


Doxygen commands

/struct to document a C-struct.

/union to document a union.

/enum to document an enumeration type.

/fn to document a function.

/var to document a variable or typedef or enum value.

/def to document a #define.

/file to document a file.

/namespace to document a namespace.

/package to document a Java package.

/interface to document an IDL interface.


Sample structcmd.h

/*! /file structcmd.h

/brief A Documented file.




/*! /def MAX(a,b)

/brief A macro that returns the maximum of /a a and /a b.




/*! /var typedef unsigned int UINT32

/brief A type definition for a .




/*! /var int errno

/brief Contains the last error code.

/warning Not thread safe!



/*! /fn int open(const char *pathname,int flags)

/brief Opens a file descriptor.

/param pathname The name of the descriptor.

/param flags Opening flags.



/*! /fn int close(int fd)

/brief Closes the file descriptor /a fd.

/param fd The descriptor to close.



/*! /fn size_t write(int fd,const char *buf, size_t count)

/brief Writes /a count bytes from /a buf to the filedescriptor /a fd.

/param fd The descriptor to write to.

/param buf The data buffer to write.

/param count The number of bytes to write.



/*! /fn int read(int fd,char *buf,size_t count)

/brief Read bytes from a file descriptor.

/param fd The descriptor to read from.

/param buf The buffer to read into.

/param count The number of bytes to read.



#define MAX(a,b) (((a)>(b))?(a):(b))

typedef unsigned int UINT32;

int errno;

int open(const char *,int);

int close(int);

size_t write(int,const char *, size_t);

int read(int,char *,size_t);



How to create template of configuration file?

Use syntax: doxygen –g <config-file > to create template. If <config-file> has been omitted, ‘Doxyfile’ will be produced. If ‘Doxyfile’ has existed, original file will be renamed as ‘Doxyfile.bak’.  For example:

#doxygen –g dragoon-doxy

Dragoon project’s configuration file will be generated in the current directory. If qt is available in users’ system, doxywizard can be used for GUI.


[How to generate list]

Doxygen has a number of ways to create lists of items.

1. Using dashes

By putting a number of column-aligned minus signs at the start of a line, a bullet list will automatically be generated. Numbered lists can also be generated by using a minus followed by a hash.


* A list of events:

* - mouse events

*    -# mouse move event

*    -# mouse click event/n

*        More info about the click event.

*    -# mouse double click event

* - keyboard events

*    -# key down event

*    -# key up event


* More text here.




A list of events:

·mouse events

1. mouse move event

2. mouse click event

More info about the click event.

3. mouse double click event

·keyboard events

1. key down event

2. key up event

You can end a list by starting a new paragraph or by putting a dot (.) on an empty line at the same indent level as the list you would like to end.

For example:


* Text before the list

* - list item 1

*   - sub item 1

*      - sub sub item 1

*      - sub sub item 2

*      .

*      The dot above ends the sub sub item list.

*      More text for the first sub item

*   .

*   The dot above ends the first sub item.

*   More text for the first list item

*   - sub item 2

*   - sub item 3

* - list item 2

* .

* More text in the same paragraph.



2. Using HTML commands


* A list of events:

* <ul>

*    <li> mouse events

*        <ol>

*            <li>mouse move event

*            <li>mouse click event/n

*                 More info about the click event.

*            <li> mouse double click event

*        </ol>

*    <li> keyboard events

*        <ol>

*             <li>key down event

*             <li>key up event

*        </ol>

* </ul>

* More text here.



3. Using /arg or /li

/arg /c AlignLeft left alignment.

/arg /c AlignCenter center alignment.

/arg /c AlignRight right alignment

/c <word> displays word using typewriter font.

/b <word> displays word using bold font.


·AlignLeft left alignment.

·AlignCenter center alignment.

·AlignRight right alignment


FIND_PACKAGE(Doxygen) OPTION(BUILD_DOCUMENTATION "Create and install the HTML based API documentatio...
  • shyanyang
  • shyanyang
  • 2015年01月14日 20:11
  • 2916


# Doxyfile 1.8.7 # This file describes the settings to be used by the documentation system # doxyge...
  • syrchina
  • syrchina
  • 2014年09月11日 14:45
  • 4165

how to install window exe program on ubuntu

the source page is from: 1. install playonlin...
  • seamanj
  • seamanj
  • 2016年05月25日 19:40
  • 392

How to install repo

  • sayyanfu
  • sayyanfu
  • 2011年02月18日 17:23
  • 4388

PBRT Ubuntu Compile and use

If you want to experiment with Physically Based Rendering, PBRT is the tool to use. Unfortunately,...
  • zhoucy163
  • zhoucy163
  • 2013年05月21日 11:45
  • 817

How to use Trace2UML together with Doxygen

How to use Trace2UML together with Doxygen From Doxygen version 1.5.3 doxygen supports sequence cha...
  • gxp
  • gxp
  • 2012年03月28日 08:49
  • 897

How To Install and Use Redis

 How To Install and Use Redis Author: Etel Sverdlov • Published: Aug 16, 2012 • Up...
  • wilsonke
  • wilsonke
  • 2014年10月29日 18:13
  • 750

How to install and use selenium

Selenium is a suite of tools to automate web browsers across many platforms in which you can write...
  • zlm_250
  • zlm_250
  • 2012年09月06日 09:59
  • 371


一、在Ubuntu14.04下使用apt-get install命令即可安装doxygen命令行工具和相应的GUI工具,命令如下: sudo apt-get install doxygen sud...
  • qq632544991p
  • qq632544991p
  • 2015年06月25日 22:21
  • 1377

Linux Doxygen的安装与使用

1、安装 yum -y install doxygen* 2、使用 (1)在工程目录下输入doxygen -s -g doxyconfig,其中doxyconfig为生成配置的文件名称,可任意指定...
  • joyjj0218
  • joyjj0218
  • 2015年11月17日 15:51
  • 1324
您举报文章:How to install and use doxygen