Support This Project

Windows build instructions using Visual Studio 2005

This page will guide you in how to build/compile wzdftpd on Windows. Important: these instructions are designed for releases of wzdftpd above (but not including) version 0.8.1. This is due to the CMAKE build process only being implemented after the official 0.8.1 release. Therefore to compile releases 0.8.1 and prior, you do not need to use CMAKE at all - you have to do it the old fashioned way with configure.

Required dependencies

OpenSSL

OpenSSL is a cryptographic library which handles Transport Layer Security in wzdftpd.

Download the latest full featured (not the lite version) Windows 32bit OpenSSL installer from Shining Light Productions and install the to your computer. If asked to overwrite any files during installation, do so.

This package includes the binaries (which a lot of Windows internet applications depend on) as well as libraries and header files used for compiling and linking your source code to the binaries.

Flex

Flex is a fast lexical analyser generator. It is a tool for generating programs that perform pattern-matching on text.

Download the latest binaries from GnuWin32 and extract the flex.exe into a directory such as c:\bin\ or another directory where all your build/compile tools are located.

You will need to set an environment variable in Windows to point to this directory. Edit both the User and System PATH variables and add a semicolon to the end, followed by the path to where you copied flex.exe.

CMake

CMake is an extensible, open-source system that manages the build process in an operating system and compiler independent manner. Unlike many cross-platform systems, CMake is designed to be used in conjunction with the native build environment. Simple configuration files placed in each source directory (called CMakeLists.txt files) are used to generate standard build files (e.g., makefiles on Unix and projects/workspaces in Windows MSVC) which are used in the usual way. CMake can compile source code, create libraries, generate wrappers, and build executables in arbitrary combinations.

CMake minimum required version is 2.6

Download the latest version from the CMake website and install it.

Optional dependencies

These packages are optional, and are used (if present) to build modules to add features to wzdftpd.

PostgreSQL

PostgreSQL is a relational database which can be used to store users and groups in wzdftpd. If you want to build the PostgreSQL module, download the latest version from PostgreSQL website and install it. Don't forget ton install development headers and libraries (including MSVC libs), since they are not installed by default.

MySQL

MySQL is a relational database which can be used to store users and groups in wzdftpd. If you want to build the MySQL module, download the latest version from MySQL website and install it (the community edition is fine). Don't forget ton install development headers and libraries (including MSVC libs), since they are not installed by default.

Perl

Perl is a scripting language which can be used to extend wzdftpd. Download the Perl implementation ActivePerl and install it.

Tcl

Tcl is a scripting language which can be used to extend wzdftpd. Download the Tcl implementation ActiveTcl and install it.

SQLite

SQLite is a small standalone SQL database library which allows wzdftpd to use SQLite as a backend. You will need to download the .dll binary prebuilt for Windows (sqlitedll-???.zip) and the .zip version of the source code (sqlite-source-???.zip). Extract all of these files to C:\SQLite3 or C:\Program Files\SQLite3.

You may notice that no library file (.lib) is included. You will need to manually create this file by opening up the Visual Studio build environment in a command prompt window (Start Menu -> Programs -> Microsoft Visual Studio 2005 -> Visual Studio Tools -> Visual Studio 2005 Command Prompt). Navigate to the directory where you unzipped the SQLite files and type the following command:

lib /def:sqlite3.def

You should see output similar to the following:

Microsoft (R) Library Manager Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.

LIB : warning LNK4068: /MACHINE not specified; defaulting to X86
   Creating library sqlite3.lib and object sqlite3.exp

And sqlite3.lib as well as sqlite3.exp should both appear in the same directory.

Configure Project (using CMake)

Step 1

When you load up CMake, you will be asked for two directories:

  • Where is the source code
  • Where to build the binaries

The source code directory should be changed to point to a location where you have checked out the SVN trunk of wzdftpd. The binaries directory should point elsewhere, to a new directory where you would like to store the CMake configuration, Visual Studio (or alternative) project files and compiled output binaries/libraries. Do not specify the same folder for both the source and binary directories because:

  • CMake configuration will be reset whenever you update the local source from the SVN trunk
  • Committing to the SVN trunk will be harder, as you don't want to commit a whole bunch of new junk binary files

After you've specified the two directories, click the Configure button. You will be asked to select which build system you will be using to compile wzdftpd. For example: if you use Microsoft Visual Studio 2005, select Build For: Visual Studio 8 2005.

You may get some warning dialogs appear such as:

  • Cannot find GnuTLS version 1.3.0 or above
  • CMake Error: Could not find the debug and release version of openssl
  • CMake Error: Error in configuration process, project files may be invalid

Just click OK to suppress all of these warnings.

You should now see a list of Cache Values appear in two columns. The left column will have a light red background.

Step 2

Set the following Cache Values:

  • BUILD_TESTING: ON
  • CMAKE_INSTALL_PREFIX: C:/Program Files/WZDFTPD
  • EXECUTABLE_OUTPUT_PATH: (The same path you specified in step 1 above for the binaries output)
  • LIBRARY_OUTPUT_PATH: (The same path you specified in step 1 above for the binaries output)
  • LIB_EAY_DEBUG: C:/Program Files/OpenSSL/lib/VC/libeay32MDd.lib
  • LIB_EAY_RELEASE: C:/Program Files/OpenSSL/lib/VC/libeay32MD.lib
  • OPENSSL_INCLUDE_DIR: C:/Program Files/OpenSSL/include/openssl
  • SSL_EAY_DEBUG: C:/Program Files/OpenSSL/lib/VC/ssleay32MDd.lib
  • SSL_EAY_RELEASE: C:/Program Files/OpenSSL/lib/VC/ssleay32MD.lib
  • WITH_GnuTLS: OFF
  • WITH_MySQL: (Optional: ON if you want to use the MySQL backend)
  • WITH_OpenSSL: ON

Note that the LIB_EAY and SSL_EAY paths may be different for you depending on which build environment/compiler you use and if you don't want to use the multi-threaded OpenSSL libraries (MD in the filename). The d on the end of the library name means that it is the debug version. Please see this OpenSSL page for more information on the type of libraries which can be used and the difference between ML, MT and MD.

Once again, click the Configure button to apply these settings.

Step 3

The list of Cache Values should now have changed, and will require a second round of configuring as follows:

  • WITH_IPV6: (Optional: ON if you want to build wzdftpd with IPv6 support)
  • WITH_PerlDev: (Optional: ON if you want to use Perl with wzdftpd)
  • WITH_PostgreSQL: (Optional: ON if you want to use the PostgreSQL backend)
  • WITH_SQLite3: (Optional: ON if you want to use the SQLite3 backend)
  • WITH_TCLDev: (Optional: ON if you want to use TCL with wzdftpd)
  • WITH_TESTS: (Optional: ON if you want to compile the wzdftpd test applications as well)
  • WITH_UTF8: (Optional: ON if you want to enable UTF-8 support)
  • WITH_Zeroconf: (Optional: ON if you want to enable Zeroconf support)

Once you have selected which features to enable/disable, click the Configure button again.

Step 4

You should now have a list of Cache Values with no items highlighted in light red. However, there may be a few values that are hidden and still need updating. Click the Show Advanced Values checkbox, and a whole bunch more options will appear in the Cache Values list.

Most of the options can safely be left as their default. However the following ones may require your attention, depending on which features you enabled through steps 2 and 3 above:

  • MYSQL_INCLUDE_DIR: (The path to where your MySQL .h include files are located)
  • MYSQL_LIBRARIES: (The path to where you MySQL .lib libraries are located)
  • PERL_EXECUTABLE: (The path to your Perl binary application)
  • PERL_INCLUDE_PATH: (The path to where your Perl .h include files are located)
  • PERL_LIBRARY: (The path to where your Perl .lib libraries are located)
  • POSTGRESQL_INCLUDE_DIR: (The path to where your PostgreSQL .h include files are located)
  • POSTGRESQL_LIBRARIES: (The path to where your PostgreSQL .lib libraries are located)
  • SQLITE3_INCLUDE_DIR: (The path to where your SQLite .h include files are located)
  • SQLITE3_LIBRARIES: (The path to where you SQLite .lib libraries are located)
  • TCL_INCLUDE_PATH
  • TCL_LIBRARY
  • TCL_LIBRARY_DEBUG
  • TCL_STUB_LIBRARY
  • TCL_STUB_LIBRARY_DEBUG
  • TCL_TCLSH
  • TK_INCLUDE_PATH
  • TK_INTERNAL_PATH
  • TK_LIBRARY
  • TK_LIBRARY_DEBUG
  • TK_STUB_LIBRARY
  • TK_STUB_LIBRARY_DEBUG
  • TK_WISH

Once you've fixed up/specified the correct paths required for external libraries click the Configure button one last time. Remember that if you only use the plaintext backend, there is no need to enable the whole bunch of WITH_... values and hence no need to specify paths for libraries which will not be used when compiling wzdftpd.

Click OK to quit CMake. All the files and configuration needed to build the wzdftpd project are now outputted to the binaries path you specified in step 1. If using Microsoft Visual Studio 2005, open up WZDFTPD.sln to get started with the building process.

Build project

Makefiles

If your target is using Makefiles, you can build the project with the usual command "make".

Visual Studio

If the target is visual studio, a project file (ex: WZDFTPD.SLN) is generated. Open it in Visual Studio, and build the project as usual.

Note: you can edit the project files and options, but be warned that re-running CMake will overwrite your changes.


This guide is Work-In-Progress and will be finished later