Windows Compile Guide (MSVC)

From WarzoneWiki

Jump to: navigation, search

This will guide you through the steps necessary to compile Warzone on Windows using Microsoft Visual C++. Alternatively, there is a guide dedicated to compiling with MinGW, the Windows Compile Guide (MinGW).

Contents

Prerequesites

  • Current version of TortoiseSVN
  • Flex 2.5 and Bison 1.8 (Bison 2.1 will NOT work)
  • Warzone Developer's Package
  • Microsoft Visual C++, eg. the MSVC 2008 Express Edtion
  • Microsoft Platform SDK (~400mb)
  • Additional GnuWin packages: GetText, PNG Lib, Ogg and Zlib. The easiest way to get all of these is to use the GetGnuWin32 intalled which will download and install all the latest GNU Win Packages. You will need to downgrade Bison to 1.8. The supplied 2.1 will not work, 2.3 might work, but it is unreliable.
  • Be Advised: Many packages in GnuWin32 are badly out of date and you find may yourself updating them from a variety of sources as this project continues

Downloading the sourcecode

  1. Create a directory where you want to store the Warzone sourcecode. You will need the path to the sourcecode, so remember it's location!
  2. Right-click on it and choose “SVN Checkout…”
  3. Set “URL of repository” to svn://svn.gna.org/warzone/trunk, leave everything else as is and click OK
  4. TortoiseSVN will now checkout the current sourcecode from our SVN repository. This may take a while, especially on slow internet connections

Preparing

  1. Extract the Developer's Package into the directory where you have the Warzone 2100 sourcecode, right where the src/ and data/ directories are.
  2. Open the Solution (Warzone2100.sln, MSVC 2005 or higher required) or the Project (Warzone2100.vcproj)
  3. Set your environment PATH variable to include:
    • The ”../GnuWin32/bin” directory. This should be where your bison.exe, flex.exe and gettext files were installed.
    • The Windows SDK /bin/ directory.
  4. Under Properties –> Debugging –> Set the Working directory to where your exe will compile.
  5. Under Properties –> Debugging –> Set your additional command line arguments. At a minimum you should specify the data directory using the --datadir commandline option

Compile

  • Choose “Build / Solution” from the menu

Final steps

  • Copy the “OpenAL32.dll”, “SDL.dll” and “wrap_oal.dll” files to the folder containing the exe.
  • You may have to point Warzone to the correct data files by adding the --datadir commandline option