# Chapter 1 - Installing HTMLDOC

This chapter describes the steps needed to install HTMLDOC on your system from the source distributions.

## Requirements

HTMLDOC requires C and C++ compilers - recent versions of GCC/Clang work fine. To build the GUI you'll also need:

- Fast Light Tool Kit ("FLTK"), version 1.1.x or 1.3.x.
- X11 libraries, R5 or higher (needed to build under UNIX/Linux only.)

Secure (https) URL support can be enabled via the OpenSSL or GNU TLS libraries, among others.

## Compiling under UNIX/Linux

HTMLDOC uses a configuration script produced by GNU autoconf to configure itself for your system. If your C compiler is not called cc or gcc, set the `CC` environment variable to the name and path of your C compiler:

        % setenv CC /path/to/compiler ENTER         [C Shell]
        % CC=/path/to/compiler; export CC ENTER     [Bourne/Korn Shell]

Similarly, if your C++ compiler is not called CC, gcc, c++, or g++, set the `CXX` environment variable to the name and path of your C++ compiler:

        % setenv CXX /path/to/compiler ENTER        [C Shell]
        % CXX=/path/to/compiler; export CXX ENTER   [Bourne/Korn Shell]

Then run the following command to configure HTMLDOC for installation in the default directories:

        % ./configure ENTER

The default configuration will install HTMLDOC in the /usr/bin directory with the data files under /usr/share/htmldoc and the documentation and on-line help under /usr/share/doc/htmldoc. Use the `--prefix` option to change the installation prefix to a different directory such as /usr/local:

        % ./configure --prefix=/usr/local ENTER

If the OpenSSL library is not installed in a standard location for your compilers, use the `--with-openssl-includes` and `--with-openssl-libs` options to point to the OpenSSL library:

        % ./configure --with-openssl-libs=/path/to/openssl/lib \
            --with-openssl-includes=/path/to/openssl ENTER

HTMLDOC is built from a Makefile in the distribution's main directory. Simply run the "make" command to build HTMLDOC:

        % make ENTER

If you get any fatal errors, please report them on the `htmldoc` mailing list referenced on the HTMLDOC project page.

Please note the version of HTMLDOC that you are using as well as any pertinent system information such as the operating system, OS version, compiler, and so forth. Omitting this information may delay or prevent a solution to your problem.

Once you have compiled the software successfully, you may install HTMLDOC by running the following command:

        % make install ENTER

If you are installing in a restricted directory like /usr then you'll need to be logged in as root.

## Compiling on Windows Using Visual C++

A Visual C++ 2008 workspace file and associated project files are included in the source distribution under the "visualc" directory. Open the workspace file "htmldoc.dsw", adjust the FLTK include and project file locations, and then build the HTMLDOC target.

Note: You also need to download the FLTK library in order to compile HTMLDOC with Visual C++.

## Installing with Visual C++

To install HTMLDOC with Visual C++, open the MSI file that is created by the Visual C++ solution file. That will populate the necessary registry entries:

`HKEY_LOCAL_MACHINE\Software\HTMLDOC\data`
  C:\installation\directory
`HKEY_LOCAL_MACHINE\Software\HTMLDOC\doc`
  C:\installation\directory\doc