# Installation

First go to the download page to get the latest distribution, if you did not have it already.

This section is divided into the following sections:

- Compiling from source on Unix
- Installing the binaries on Unix
- Known compilation problems for Unix
- Compiling from source on Windows
- Installing the binaries on Windows
- Tools used to develop doxygen

## Compiling from source on Unix

If you downloaded the source distribution, you need at least the following to build the executable:

- The GNU tools flex, bison and make
- In order to generate a Makefile for your platform, you need perl .

To take full advantage of doxygen's features the following additional tools should be installed.

- Troll Tech's GUI toolkit Qt version 2 or higher. This is needed to build the GUI front-end doxywizard.
- A distribution: for instance teTeX 1.0 . This is needed for generating LaTeX, Postscript, and PDF output.
- the Graph visualization toolkit version 1.8.10 or higher . Needed for the include dependency graphs, the graphical inheritance graphs, and the collaboration graphs. If you compile graphviz yourself, make sure you do include freetype support (which requires the freetype library and header files), otherwise the graphs will not render proper text labels.
- The ghostscript interpreter. To be found at www.ghostscript.com.

Compilation is now done by performing the following steps:

1. Unpack the archive, unless you already have done that:

           gunzip doxygen-$VERSION.src.tar.gz    # uncompress the archive
           tar xf doxygen-$VERSION.src.tar       # unpack it

2. Run the configure script:

           sh ./configure

   The script tries to determine the platform you use, the make tool (which must be GNU make) and the perl interpreter. It will report what it finds.

   To override the auto detected platform and compiler you can run configure as follows:

           configure --platform platform-type

   See the `PLATFORMS` file for a list of possible platform options.

   If you have Qt-3.2.x or higher installed and want to build the GUI front-end, you should run the configure script with the `--with-doxywizard` option:

           configure --with-doxywizard

   For an overview of other configuration options use

           configure --help

3. Compile the program by running make:

           make

   The program should compile without problems and three binaries (`doxygen` and `doxytag`) should be available in the bin directory of the distribution.

4. Optional: Generate the user manual.

           make docs

   To let doxygen generate the HTML documentation.

   Note:
     You will need the stream editor `sed` for this, but this should be available on any Unix platform.
   The HTML directory of the distribution will now contain the html documentation (just point a HTML browser to the file `index.html` in the html directory).

5. Optional: Generate a PDF version of the manual (you will need `pdflatex`, `makeindex`, and `egrep` for this).

           make pdf

   The PDF manual `doxygen_manual.pdf` will be located in the latex directory of the distribution. Just view and print it via the acrobat reader.

## Installing the binaries on Unix

After the compilation of the source code do a `make install` to install doxygen. If you downloaded the binary distribution for Unix, type:

        ./configure
        make install

Binaries are installed into the directory `<prefix>/bin`. Use `make install_docs` to install the documentation and examples into `<docdir>/doxygen`.

`<prefix>` defaults to `/usr` but can be changed with the `--prefix` option of the configure script. The default `<docdir>` directory is `<prefix>/share/doc/packages` and can be changed with the `--docdir` option of the configure script.

Alternatively, you can also copy the binaries from the `bin` directory manually to some `bin` directory in your search path. This is sufficient to use doxygen.

Note:
  You need the GNU install tool for this to work (it is part of the fileutils package). Other install tools may put the binaries in the wrong directory!

If you have a RPM or DEP package, then please follow the standard installation procedure that is required for these packages.

## Known compilation problems for Unix

Qt problems

The Qt include files and libraries are not a subdirectory of the directory pointed to by QTDIR on some systems (for instance on Red Hat 6.0 includes are in /usr/include/qt and libs are in /usr/lib).

The solution: go to the root of the doxygen distribution and do:

       mkdir qt
       cd qt
       ln -s your-qt-include-dir-here include
       ln -s your-qt-lib-dir-here lib
       export QTDIR=$PWD

If you have a csh-like shell you should use `setenv QTDIR $PWD` instead of the `export` command above.

Now install doxygen as described above.

Bison problems

Versions 1.31 to 1.34 of bison contain a "bug" that results in a compiler errors like this:

ce_parse.cpp:348: member `class CPPValue yyalloc::yyvs' with constructor not allowed in union

This problem has been solved in version 1.35 (versions before 1.31 will also work).

Latex problems

The file `a4wide.sty` is not available for all distributions. If your distribution does not have it please select another paper type in the config file (see the PAPER_TYPE tag in the config file).

HP-UX & Digital Unix problems

If you are compiling for HP-UX with aCC and you get this error:

        /opt/aCC/lbin/ld: Unsatisfied symbols:
        alloca (code)

then you should (according to Anke Selig) edit `ce_parse.cpp` and replace

        extern "C" {
          void *alloca (unsigned int);
        };

with

        #include <alloca.h>

If that does not help, try removing `ce_parse.cpp` and let bison rebuild it (this worked for me).

If you are compiling for Digital Unix, the same problem can be solved (according to Barnard Schmallhof) by replacing the following in ce_parse.cpp:

        #else /* not GNU C.  */
        #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) \
            || defined (__sparc) || defined (__sgi)
        #include <alloca.h>

with

        #else /* not GNU C.  */
        #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) \
            || defined (__sparc) || defined (__sgi) || defined (__osf__)
        #include <alloca.h>

Alternatively, one could fix the problem at the bison side. Here is patch for bison.simple (provided by Andre Johansen):

    --- bison.simple~       Tue Nov 18 11:45:53 1997
    +++ bison.simple        Mon Jan 26 15:10:26 1998
    @@ -27,7 +27,7 @@
     #ifdef __GNUC__
     #define alloca __builtin_alloca
     #else /* not GNU C.  */
    -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) \
         || defined (__sparc) || defined (__sgi)
    +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) \
         || defined (__sparc) || defined (__sgi) || defined (__alpha)
     #include <alloca.h>
     #else /* not sparc */
     #if defined (MSDOS) && !defined (__TURBOC__)

The generated scanner.cpp that comes with doxygen is build with this patch applied.

Sun compiler problems

It appears that doxygen doesn't work properly if it is compiled with Sun's C++ WorkShop Compiler. I cannot verify this myself as I do not have access to a Solaris machine with this compiler. With GNU compiler it does work.

when configuring with `--static` I got:

    Undefined                       first referenced
     symbol                             in file
    dlclose                             /usr/lib/libc.a(nss_deffinder.o)
    dlsym                               /usr/lib/libc.a(nss_deffinder.o)
    dlopen                              /usr/lib/libc.a(nss_deffinder.o)

Manually adding `-Bdynamic` after the target rule in `Makefile.doxygen` and `Makefile.doxytag` will fix this:

    $(TARGET): $(OBJECTS) $(OBJMOC)
            $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) -Bdynamic

GCC compiler problems

Older versions of the GNU compiler have problems with constant strings containing characters with character codes larger than 127. Therefore the compiler will fail to compile some of the translator_xx.h files. A workaround, if you are planning to use the English translation only, is to configure doxygen with the `--english-only` option.

On some platforms (such as OpenBSD) using some versions of gcc with -O2 can lead to eating all memory during the compilation of files such as config.cpp. As a workaround use --debug as a configure option or omit the -O2 for the particular files in the Makefile.

Gcc versions before 2.95 may produce broken binaries due to bugs in these compilers.

Dot problems

Due to a change in the way image maps are generated, older versions of doxygen (<=1.2.17) will not work correctly with newer versions of graphviz (>=1.8.8). The effect of this incompatibility is that generated graphs in HTML are not properly clickable. For doxygen 1.3 it is recommended to use at least graphviz 1.8.10 or higher.

Red Hat 9.0 problems

If you get the following error after running make

    tmake error: qtools.pro:70: Syntax error

then first type

    export LANG=

before running make.

## Compiling from source on Windows

Currently, I have only compiled doxygen for Windows using Microsoft's Visual C++ (version 6.0). For other compilers you may need to edit the perl script in `wintools/make.pl` a bit. Let me know what you had to change if you got Doxygen working with another compiler. If you have Visual Studio you can also use the .dsw file found in the `wintools` directory. Note that this file is not maintained by me, so it might be outdated a little.

If you have Visual C++ 6.0, and the source distribution, you can easily build doxygen using the project files in the `wintools` directory. If you want to build the CVS sources, or want to build from the command line, or with another compiler, you have to follow the steps below.

Thomas Baust reported that if you have Visual Studio.NET (2003) then you should be aware that there is a problem with the _popen() and _pclose() implementation, which currently leaks handles, so if you build doxygen with it and use the INPUT_FILTER, you will run to risk of crashing Windows! The problem is reported to and confirmed by Microsoft so maybe it will fixed in the next service pack.

Since Windows comes without all the nice tools that Unix users are used to, you'll need to install a number of these tools before you can compile doxygen for Windows from the command-line.

Here is what is required:

- An unzip/untar tool like WinZip to unpack the tar source distribution. This can be found at http://www.winzip.com/

  The good, tested, and free alternative is the `tar` utility supplied with cygwin tools. Anyway, the cygwin's flex, bison, and sed are also recommended below.

- Microsoft Visual C++ (I only tested with version 6.0). Use the `vcvars32.bat` batch file to set the environment variables (if you did not select to do this automatically during installation).

  Borland C++ or MINGW (see http://www.mingw.org/) are also supported.

- Perl 5.0 or higher for Windows. This can be downloaded from: http://www.ActiveState.com/Products/ActivePerl/

- The GNU tools flex, bison, and sed. To get these working on Windows you should install the cygwin tools

  Alternatively, you can also choose to download only a small subset of the cygwin tools that I put together just to compile doxygen.

  As a third alternative one could use the GNUWin32 tools that can be found at http://gnuwin32.sourceforge.net/

  Make sure the `BISON_SIMPLE` environment variable points to the location where the files `bison.simple` and is located. For instance if these file is in `c:\tools\cygwin\usr\share` then BISON_SIMPLE should be set to `c:/tools/cygwin/usr/share/bison.simple`

  Also make sure the tools are available from a dos box, by adding the directory they are in to the search path.

  For those of you who are very new to cygwin (if you are going to install it from scratch), you should notice that there is an archive file `bootstrap.zip` which also contains the `tar` utility (`tar.exe`), `gzip` utilities, and the `cygwin1.dll` core. This also means that you have the `tar` in hands from the start. It can be used to unpack the tar source distribution instead of using WinZip -- as mentioned at the beginning of this list of steps.

- From Doxygen-1.2.2-20001015 onwards, the distribution includes the part of Qt-2.x.y that is needed for to compile doxygen and doxytag, The Windows specific part were also created. As a result doxygen can be compiled on systems without X11 or the commerical version of Qt.

  For doxywizard, a complete Qt library is still a requirement however. A commercial license to build doxywizard with the latest Qt library was kindly donated to me by the nice people at TrollTech. See doxygen download page for a link.

- If you used WinZip to extract the tar archive it will (apparently) not create empty folders, so you have to add the folders `objects` and `bin` manually in the root of the distribution before compiling.

Compilation is now done by performing the following steps:

1. Open a dos box. Make sure all tools (i.e. `nmake`, `latex`, `gswin32`, `dvips`, `sed`, `flex`, `bison`, `cl`, `rm`, and `perl`), are accessible from the command-line (add them to the PATH environment variable if needed).

   Notice: The use of LaTeX is optional and only needed for compilation of the documentation into PostScript or PDF. It is not needed for compiling the doxygen's binaries.

2. Go to the doxygen root dir and type:

           make.bat msvc

   This should build the executables `doxygen.exe` and `doxytag.exe` using Microsoft's Visual C++ compiler (The compiler should not produce any serious warnings or errors).

   You can use also the `bcc` argument to build executables using the Borland C++ compiler, or `mingw` argument to compile using GNU gcc.

3. To build the examples, go to the `examples` subdirectory and type:

           nmake

4. To generate the doxygen documentation, go to the `doc` subdirectory and type:

           nmake

   The generated HTML docs are located in the `..\html` subdirectory.

   The sources for LaTeX documentation are located in the `..\latex` subdirectory. From those sources, the DVI, PostScript, and PDF documentation can be generated.

## Installing the binaries on Windows

There is no fancy installation procedure at the moment (if anyone can add it in a location independent way please let me know).

To install doxygen, just copy the binaries from the `bin` directory to a location somewhere in the path. Alternatively, you can include the `bin` directory of the distribution to the path.

There are a couple of tools you may want to install to use all of doxygen's features:

- To generate LaTeX documentation or formulas in HTML you need the tools: `latex`, `dvips` and `gswin32`. To get these working under Windows install the fpTeX distribution. You can find more info at: http://www.fptex.org/ and download it from CTAN or one of its mirrors. In the Netherlands for example this would be: ftp://ftp.easynet.nl/mirror/CTAN/systems/win32/fptex/

  Make sure the tools are available from a dos box, by adding the directory they are in to the search path.

  For your information, the LaTeX is freely available set of so called macros and styles on the top of the famous TeX program (by famous Donald Knuth) and the accompanied utilities (all available for free). It is used for high quality typesetting. The result -- in the form of so called `DVI` (DeVice Independent) file -- can be printed or displayed on various devices preserving exactly the same look up to the capability of the device. The `dvips` allows you to convert the `dvi` to the high quality PostScript (i.e. PostScript that can be processed by utilities like `psnup`, `psbook`, `psselect`, and others). The derived version of TeX (the pdfTeX) can be used to produce PDF output instead of DVI, or the PDF can be produced from PostScript using the utility `ps2pdf`.

  If you want to use MikTeX then you need to select at least the medium size installation. For really old versions of MikTex or minimal installations, you may need to download the fancyhdr package separately. You can find it at: ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/supported/fancyhdr/

- If you want to generate compressed HTML help (see GENERATE_HTMLHELP) in the config file, then you need the Microsoft HTML help workshop. You can download it at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/vsconHH1Start.asp

- the Graph visualization toolkit version 1.8.10
  . Needed for the include dependency graphs, the graphical inheritance graphs, and the collaboration graphs.

## Tools used to develop doxygen

Doxygen was developed and tested under Linux using the following open-source tools:

- GCC version 3.3.1
- GNU flex version 2.5.4
- GNU bison version 1.75
- GNU make version 3.80
- Perl version 5.8.1
- VIM version 6.2
- Mozilla 1.0
- Troll Tech's tmake version 1.3 (included in the distribution)
- teTeX version 1.0
- CVS 1.10.7

Go to the next section or return to the index.