Building Zandronum from source for Windows 8.1

Many may find this interesting, because currently there are no SVN build hosts. In this mini “how to” I'll try to tell how to build Zandronum from scratch for Windows 8.1. For this article I’ve used a virtual machine with Windows 8.1 Ent RTM and built the latest Zandronum revision. Note that your Windows user (and profile C:\Users\user) must NOT contain internationalized characters! Also, you will need admin rights for editing Program Files directories.

Let's split the process by 4 stages:
1) Downloading development environments and libraries
2) Installing and configuring the environment
3) Getting the sources
4) Setting up the project, compiling and harvesting obtained binaries

If you do this not for the first time – you may proceed directly to step 3.

1. Required downloads
   
1. Microsoft Visual Studio 2013 (requires Windows 7 or higher) - you can get it anywhere you want. I use the Ultimate edition without optional components
    2. Visual Studio Libraries for Doom Ports - Includes DirectX SDK (Feb 2010), Logitech LCD SDK, SDL libraries

3. FMOD API Collection for Doom Ports - Includes various FMOD versions for all ZDoom based ports

4. NASM 2.08.02 - assembler.
5. glext.h and wglext.h - OpenGL headers
6. Mercurial 2.7.2 - program for grabbing the sources.


2. Installing programs
1. Install Visual Studio 2013. Upon the first launch select "Visual C++ Development Layout" in popup window.
2. Extract NASM archive into "C:\Program Files\Windows Kits\8.1\bin\x86".
3. Place OpenGL headers to "C:\Program Files\Windows Kits\8.1\Include\um\gl".
4. Extract Doom libraries to C:\ (will be C:\libs), extract FMOD collection to C:\libs.
5. Install Mercurial into default directory. Don't uncheck "Add the installation path to the search path" in last step of wizard!

3. Obtaining source code

1) Let's download the latest sources. Open a console (cmd.exe) and go to folder you need. Execute a command:
hg clone https://bitbucket.org/Torr_Samaho/zandronum
Sources will be downloaded to zandronum subfolder. If you see corrupted fonts of hg program, delete the folder "C:\Program Files\Mercurial\locale".
2) If you want you may download a stable version. Point mouse cursor to "tags" label, select the version you want, then point mouse to "get source" and select zip. Extract the downloaded archive to a folder you need.
3) To update the existing source code, execute that command again:
hg clone https://bitbucket.org/Torr_Samaho/zandronum

4. Setting up the project, compiling and harvesting obtained binaries
1) Open Visual Studio and load file zandronum.sln. In popup window (One-way upgrade) press OK. Close the migration report (should be 0 errors)
2) In second dropdown on toolbar (Solution Configurations) select "Release".
3) Right click on zandronum in Solution Explorer, select Properties. In popup window go to VC++ Directories.
4) Add the following paths to Include Directories:
C:\libs\include
C:\libs\fmod424\api\inc
5) Add the following paths to Library Directories:
C:\libs\lib\x86
C:\libs\fmod424\api\lib
6) Press OK, Save the solution (Ctrl+Shift+S).
7) Launch compilation process by selecting Menu Build - Build Solution.
8) During the first time build the process will fail. Leave Visual Studio open and edit file src\win32\zdoom.rc in the Zandronum source. Comment out lines 44 and 605:
3 TEXTINCLUDE MOVEABLE PURE
BEGIN
"#ifndef NO_MANIFEST\r\n"
// " CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST ""zdoom.exe.manifest""\r\n"
"#endif\r\n"
END
#ifndef NO_MANIFEST
// CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "zdoom.exe.manifest"
#endif

9) Continue compilation process by selecting Menu Build - Build Solution again.
10) If some projects fail to compile try to launch the Build once again, you will see which errors exactly happened.
11) After compilation is done in parent folder relatively to "zandronum" several files should appear.
12) For Zandronum to work properly following files are required:

1. zandronum.exe, zandronum.pk3, skulltag_actors.pk3  from the folder where it was compiled.
2. fmodex.dll from C:\libs\fmod424\api

zandronum.exe is native for Windows 8.1. It can be run in Windows Vista or higher.

You will see version number in window title, in console or by "gameversion" command.