Tutorial 15:How to Compile the Source Code for Zdoom and GZDoom.
Game: Doom, Doom2.
Objective: By the end of this article the reader should be able to build the source code for Zdoom/GZDoom using VC++ 2005 Express Edition.
Resources required: See main text below.
1. First you need to download VC 2005 Express Edition from Microsoft; I got a feeling this rather old version may soon disappear, so grab it quickly from here.
2. You also need to download and install the Windows Platform SDK. The Express Edition of Visual C++ does not come with support for building native Windows applications. Download it from here.
3. You will also need the Feb 2010 Microsoft DirectX SDK package as well. Get it from here .
Starting with the June 2010 package, DirectDraw is no longer supported, preventing the compilation of ZDoom.
4.Download the Nasm assembler from here.
And the FMOD Ex from here.
5. If you fancy building the better looking Gzdoom,then you need two additional gl header files: glext.h and wglext.h; get them from here and here
If you face problems downloading these 2 files then check out Tutorial 14 of this series.
6.Finally you need to download the source code package for Zdoom from here.
For GZdoom you need to use TortoiseSVN to download the source code as a tarball is not available at the moment. Check their website here.
Once you have TortoiseSVN installed then you can get the latest updates.
1.Unzip and install all the files and resources above. Use default directories ,specially for Microsoft products.
2.Set up the search directories for all the above resources. Again follow the procedures given in the previous tutorials as I am not going to repeat that here. Have a particular look at Getting Started Part 3.
The search path for the Nasm executable must of course be set in the executable files options box, get it from Tools -> Options menu. See figure 8 below.
3.Very important tip which is not mentioned in the wiki guide: you MUST place the search paths for "Microsoft DirectX SDK" at the TOP of the lists as shown in figures 9 and 10 below or you'll probably going to get a "XUSER_MAX_COUNT" error.
4.Now you should be ready to compile Zdoom. Open the solution file and hit Build-> Build Solution. VC++ 2005 Express should immediately start compiling your files and everything seems fine until it stops with this error message:
" fatal error C1083: Cannot open include file: 'mmdeviceapi.h': No such file or directory ".
Your project is missing some resources.To remedy this you need to download the following SDK package from Microsoft:
"Windows Server 2008 and .NET Framework 3.5"
Before we proceed any further, I should point out the following: I use WindowsXp and I got this message when I tried to compile Zdoom as described above. I am not absolutely sure whether this problem exists with the other platforms (such as Vista or Win7) . If you did not get this error with your version of Windows ,then of course this means you have the required files on your system and you do not need to proceed with the following download . Your Zdoom should compile errorless.
I am detailing every step next just to make sure you get the right files to compile Zdoom and you do not end up downloading over 1 GB of resources that you do not actually need for this particular task, so bear with me please:
5. Click on this link , you should get the screen shown in figure 1 below:
6. Choose Web Setup from the above screen ,then click on DOWNLOAD as shown below:
7. Next click the Run button to start Setup as in figure 3 below:
8. Click Next in the box that appears below and say Yes to the licence agreement:
9.Install to the default folders as shown in figure 5 below, then click Next:
10.The next box shown below should appear:
11. Select the options shown ticked in figure 7 below (Header files and x86 libraries) .Unless you want to install the other files, your total download should now be around 15 MB.
12.These files should install in the following default folders:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib
It is important that you set the path for these resources in VC++ 2005. See Figures 8,9 and 10 below as was set up on my WindowsXp computer.
Figure 8 search path for nasm executable.
Figure 9 search path for the include subfolders.
Figure 10 search path for the library subfolders.
13.Now you are ready to roll. Select Build Solution from the menu.The project should now compile perfectly. Congratulations!
Figure 11 The Build process is successful!
14. To build GZdoom you need first to comment out 2 lines in this header file: intrin.h as shown below in figure 12:
15. Select Build Solution to compile Gzdoom:
Figure 13 The Build process for Gzdoom is also successful!
My greetings to R.Heit and G.Zahl for their wonderful work and for keeping Zdoom alive for so many years.
Return to Tutorials Page.