Automatically generate a document for C + + programs using Doxygen (i)

Source: Internet
Author: User
Tags doxygen

Automatically generate a document for C + + programs using Doxygen (i)

Reprint Please specify: Embedded Learning Network www.embstudy.org

These days someone asked about the documentation generation tool, and personally felt Doxygen was a good tool software for automatically generating documents from C + + annotations. Here a brief description of the use of Doxygen, for your reference.

Introduction of Doxygen

Second, to put it simply, Doxygen is a document system that can be used for C + +, C, Java, Objective-c, Python, IDL (Corba and Microsoft flavors), Fortran, VHDL, PHP, C #, a nd to some extent D and other languages generate documents.

Official website: http://www.stack.nl/~dimitri/doxygen/index.html

It can help us from three aspects:

1, it can produce HTML format of online documents or latex format of the offline reference manual, in addition it can also generate Rich Text (Ms-word), PostScript, with hyperlinks PDF, compressed Html,unix man format documents. These documents are extracted directly from the source file, which helps keep the code and document consistent.

A Doxygen the project file (. hhp), the catalog file (. hhc), and the index file (. hhk) that are used to make the CHM are automatically generated when the HTML document is exported. You can use the CHM compiler (Hhc.exe) in HTML Help Workshop to build a CHM file after compilation.

b doxygen the output of latex documents, the makefile of files converted into PDF format is generated. The PDF document can be generated from the Latex document as long as the appropriate Tex tool is installed on the system.

c) Doxygen output Rich Text format, optimized for word, and can be converted to Word documents well.

2. By configuring Doxygen, the source file structure can be extracted from the documents that are not documented, which helps us to sort out the structure of the large source package. It can automatically generate graphs that include dependency graphs, inheritance graphs, collaboration diagrams, and other relationships between elements (requiring Graphviz support).

A Graphviz is a graphical software Doxygen uses Graphviz to generate various graphics.

b) Graphviz download address http://www.graphviz.org/Download..php

3, can even "misuse" to create ordinary documents.

http://www.graphviz.org/Download..php

Iii. Doxygen Agreement

The Doxygen is published under the GPL, and you can use its source code or compiled binary files. Doxygen can run on almost all Linux-compliant systems, and it can also run in Windows environments. You can choose according to your needs.

Iv. Doxygen documentation, FAQs, users, and related articles

A) http://www.stack.nl/~dimitri/doxygen/manual.html

b) http://www.stack.nl/~dimitri/doxygen/faq.html

c) http://www.stack.nl/~dimitri/doxygen/projects.html

D) http://www.stack.nl/~dimitri/doxygen/articles.html

V. General steps for the use of Doxygen

A) Download Doxygen software http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc

b) Download Graphviz http://www.graphviz.org/Download..php

(c) Installation of Doxygen and Graphviz (optional)

D Prepare a configuration file (Doxyfile), usually generated using Doxywizard, which can then be modified (or not modified) as needed.

E to add comments to source code according to the Doxygen rules and document the code

f) Run Doxygen generate and source code corresponding to the document.

Vi. installation of Doxygen

A) the installation under Win

I. directly run Doxygen 's setup EXE file, installation prompts operation is OK

Ii. Run the Graphviz installation (EXE) file and follow the prompts (optional)

B to install Doxygen on UNIX compatible systems using the compiled source method

I. Using the source code installation Doxygen to confirm that your system is installed:

1. GNU tools such as Flex, bison and make

2. Perl

3. Configure steps require that you have standard UNIX commands on your system such as: sed, date, find, uname, MV, CP, Cat, ECHO, TR, CD, and RM, etc.

4. To use the advanced features of Doxygen, you will also need to install the following attachment tools

A) Qt3.3 or later, Doxygen uses it to build GUI front-end Doxywizard

b A latex software: such as teTeX 1.0, used to produce latex, PostScript and PDF output.

c) Graph Visualization toolkit 1.8.10 or higher. Doxygen uses it to generate include diagrams, dependency graphs, inheritance graphs, and collaboration diagrams. If you use the compiled source method to install Graphviz, your system needs freetype support.

D If you need a formula, or you do not want to use Pdflatex, you need Ghostscript, the software can be found on the www.ghostscript.com

(e) Python is also needed to produce doxygen documents of its own format, www.python.org.

Ii. Extract the downloaded Doxygen source pack

1. Tar xf doxygen-$VERSION. Src.tar

2./configure will automatically configure Doxygen according to the system and produce corresponding Makefile

A) can configure--platform Platform-type self-setting platform type

b) Configure--with-doxywizard can be graphical front-end Doxywizard

c) More information can be viewed through the configure–help and given the appropriate configuration

Iii. compiling Doxygen

1. Make

Iv. Optional Production Manuals

1. Make docs

2. Make PDF

V. Installation of Doxygen

1. Make install (requires root user privileges)

Vi. Known Issues

1. In some systems, QT header files and library files are not in the directory specified by the QTDIR environment variable:

mkdir qt cd qt ln-s your-qt-include-dir-here include Ln-s your-qt-lib-dir-here Lib Export Qtdir= $PWD

2. Bison question

A) Bison version 1.31 to 1.34 has a bug that can be used with 1.35 or 1.31 previous versions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.