Building Chocolate Doom on Windows (alternative build)

Jump to: navigation, search

Chocolate Doom on Windows XP

The official way of building Chocolate Doom on Windows is using MSYS2. However, the Chocolate Doom source code comes with alternative project files for building the code using Code::Blocks and Microsoft Visual Studio, for people who are more comfortable with those environments.

Obtaining the source code

The easiest way to download the source code is to download a ZIP of the source code for a particular release directly from the GitHub chocolate-doom page, or select "Clone or Download → Download ZIP" to download a ZIP of the source for the current development state.

Alternatively you can use a git client such as TortoiseGit or GitHub Desktop. The following instructions are for TortoiseGit:

1. After you have installed the software, right click on or in the directory you want to download the source code to. From the right click menu choose the "Git Clone..." option.

2. Enter the URL https://github.com/chocolate-doom/chocolate-doom.git into the "URL" box and click OK.

3. Wait until the source code has been downloaded (the code is several megabytes in size, so it can take a while to download it).

Using CMake

The Chocolate Doom source code from git has recently been updated with a new build system utilizing CMake, which helps ease building on Windows since CMake can create project files for recent versions of Visual Studio and Code::Blocks and speed up the process of building Chocolate Doom on Windows for those who may not be comfortable building on MSYS2.

Step 1: Getting CMake

You need to download CMake from here. You can use either the installer or the zip file. The architecture types on the download page doesn't matter for 64-bit machines, since the 64-bit CMake binaries can create projects for either 32 or 64-bit binaries.

Step 2: Installing the Development Libraries

You need to download SDL2, SDL2_net, and SDL2_mixer for either Visual Studio (VC) or Code::Blocks (MinGW). It doesn't matter where you put them since you will use CMake to locate them. Though if preferred, you can place each of them in a folder called "sdl2" so you won't have to be hunting around for the libraries. If going in that direction, the folders might look like this: \sdl2\SDL2-2.0.12
\sdl2\SDL2_net-2.0.1
\sdl2\SDL2_mixer-2.0.4\

Step 3: Compiling Chocolate Doom

You need to open CMake after installation to bring up the GUI. Then, select "browse source" to locate the folder that contains the source code. After that, select "browse build" to locate the folder where the project files and the compiled binaries should be located. Typically, it would be inside a "build" folder within the source code folder. Then select "configure." A window should pop up asking you what type of project files you want to create. Select either "Visual Studio XX 20XX" (the Xs represent the Version Number and Year) or "Code::Blocks Makefiles" (for Code::Blocks, it is best to manually specify the c and c++ compilers). For architecture, it is best to specify "Win32" instead of leaving it blank (that defaults to "x64" on 64-bit CMake binaries) since it won't benefit you in any way to build 64-bit binaries of Chocolate Doom. Once you select "okay", CMake will attempt to locate the c and c++ compilers (unless you already specified the compilers), and read every "CMakeList" files in the source code folder. Once it is all done, Some selections will appear on the GUI, this is the time to specify the locations of the SDL2 libraries and include files. Once that's done, select "generate" to generate the project files. Finally, click "open project" to open the IDE you use, depending on the project files, and within the IDE, click "build" to build the binaries. When that's done, copy every DLL files from the SDL2 libraries to the directory where the compiled binaries are located.