Wt Installation instructions for Windows

This page lists the instructions for building and installing Wt on Windows. It is organized in 3 sections:

Requirements

Wt for Windows uses the built-in web server connector - fastcgi is not supported. The built-in web server is more convenient during development and is easier to setup. To use the built-in server, you have to link your projects against libwt and libwthttp.

Requirements:

Additional and optional requirements for some of the examples

On unix systems, libraries are usually installed in standard locations, with their header files in /usr/include (or variants) and the libraries in /usr/lib (or variants). Windows does not have such standard locations for storing header files and libraries. Therefore, you will have to point out where the libraries can be found. If you follow the recommendations below, the task of specifying these paths will be require minimal effort (but you'll still have to ensure that the executable will be able to locate the DLLs at runtime, e.g. by adding the directories to PATH).

CMake will automatically locate your libraries in subdirectories of USERLIB_ROOT (defaults to c:/libraries). Use the following directories:

We stronly recommend to use libraries which are all built using the same compiler (MSVC 2005 SP1) and the same runtime configuration (/MT, /MD, /MTd or /MDd) to avoid incompatibilities with the C runtime libraries. Mixing CRTs is NOT recommended, the zlib DLL FAQ clearly explains why and what you should do about it (in short: use MSVC 2005 prebuilt libraries, and if not available, rebuild the dependency libraries from the sources).


Building and installing the Wt library

1. Run CMake

In the CMake GUI, set the 'Where is your source code' to the location where you unpacked the source code. Set 'Where to build the binaries' to a build directory (can be the same as the location of the source code). Press 'Configure' and choose 'Build For Visual Studio 8 2005'.

During configuration, you will see messages that confirm that fastcgi is disabled, and that wthttp is enabled. You will probably also receive notifications of dependencies that were not found. You can now manually adjust the paths to the dependencies and other configuration parameters, and press the 'Configure' button again. When your configuration is complete, press 'Ok' and a solution file will be generated.

Some variables you may want to change are:

CMAKE_INSTALL_PREFIX
Installation prefix for the library and include files)
CONFIGURATION
Location of the configuration file

2. Build the library and the examples

Start Microsoft Visual Studio, open the generated solution file, and select Build->Build Solution (or hit F7).

3. Install the library:

No installation is required for wt applications, as long as the application is able to locate its dependencies (.dll files). Add the directories to the dependencies to the PATH, copy them to the current directory, or to any other location where Windows looks for dll files.

Trying the examples (or your own Wt application)

Using wthttpd

1. Run the example X

in the MSVC IDE Right-click on the example project you want to run, and select 'Properties'. In Configuration Properties->Debugging, set the Command Arguments to
--http-address=0.0.0.0 --http-port=8080 --deploy-path=/hello --docroot=.
The easiest way to locate the dependency dlls, is to append their location to the PATH variable. In order to do so, change the Environment field to contain a PATH directive:
PATH=c:/libraries/lib;c:/Boost/lib;<path to wt.dll>;<path to wthttp.dll>

This will start a httpd server listening on all local interfaces, on port 8080, and you may browse the example at http://127.0.0.1:8080/hello

These are all the command-line options that are available:

General options:
  -h [ --help ]              produce help message
  -t [ --threads ] arg (=10) number of threads
  --docroot arg              document root for static files
  --no-compression           do not compress dynamic text/html and text/plain 
                             responses
  --deploy-path arg (=/)     location for deployment

HTTP server options:
  --http-address arg    IPv4 (e.g. 0.0.0.0) or IPv6 Address (e.g. 0::0)
  --http-port arg (=80) HTTP port (e.g. 80)

HTTPS server options:
  --https-address arg     IPv4 (e.g. 0.0.0.0) or IPv6 Address (e.g. 0::0)
  --https-port arg (=443) HTTPS port (e.g. 443)
  --ssl-certificate arg   SSL server certificate chain file
                          e.g. "/etc/ssl/certs/vsign1.pem"
  --ssl-private-key arg   SSL server private key file
                          e.g. "/etc/ssl/private/company.pem"
  --ssl-tmp-dh arg        File for temporary Diffie-Hellman parameters
                          e.g. "/etc/ssl/dh512.pem"