Compiling on Windows using Microsoft Visual C++ 2005
/File/en/Content.png
Historic content
This page or section contains content that is no longer relevant for the current version of OpenTTD. Please keep it intact because it shows some of the history of this wiki as documentation.
This page is only valid up to version 1.8. Later versions require Visual C++ 2015 or newer.

This article gets you started on compiling OpenTTD using Microsoft Visual C++ 2005 Express Edition.

Contents

Required software

Download these pieces of software. Then follow the installation instructions provided in this article.

  1. Microsoft Visual C++ 2005 Express Edition
  2. Microsoft® Windows® SDK
  3. Microsoft® DirectX® SDK August 2007
  4. openttd-useful.zip, a collection of files of varying age.
  5. TortoiseSVN
  6. The newest source from svn://svn.openttd.org/trunk; download with TortoiseSVN.

Note: This guide has been made on Windows XP with VTP applied. For Vista, see the guide for MSVC++ 2008 Express.

Alternative files

For the latest zlib, libpng and FreeType files you can browse their websites below.

While TortoiseSVN is great for SVN novices, some advanced developers prefer the command line SVN client:

Installation and setup

/File/en/Archive/Compilation and Ports/Psdk custom1.png

/File/en/Archive/Compilation and Ports/Psdk custom2.png

Setting up includes and libraries

Now extract the Openttd-useful.zip file and copy:

Setting up the DirectX SDK

Well, from the components screen remove the documentation and sample source code you'll save a lot of space (800+ MB). They're pretty useless if you just need to compile OpenTTD. Note:You should not use a version newer than August 2007 as DirectMusic is no longer supported as of the November 2007 release.

Setting up the VC++ Directories

Go to Tools -> Options, then to Projects and Solutions -> VC++ Directories. Add the following lines:

Executable files:

Include files:

Library files:

Note: Please update the paths as necessary.

/File/en/Archive/Compilation and Ports/Msvc exe screen.png

/File/en/Archive/Compilation and Ports/Msvc include screen.png

/File/en/Archive/Compilation and Ports/Msvc lib screen.png

Only a few changes are required to use the Platform SDK with Visual C++ 2005 Express. Please follow steps 3, 4 and maybe 5 of the guide from Microsoft.

Compiling

Open projects/openttd_vs80.sln. This will open your IDE with the project loaded. If you want to compile a debug version straight ahead, press F7 and enjoy. To compile a non-debug version, go to Build -> Configuration Manager and select Release for OpenTTD. Press F7.