Building:Win32:VisualStudio

From FIFE development wiki
Jump to: navigation, search

Xp-flag-32x32.png Platform-dependent information: Win32.

The following passage contains information that is specific to Windows operating systems.

Changes in progress...

Introduction

This guide describes how to build FIFE with Microsoft Visual Studio and the Win32 DevKit.

Requirements

Visual Studio 2005 (VS8)

  1. Add Folder.png \Microsoft Platform SDK for Windows Server 2003 R2\Include to the list of directories where the compiler searches for headers (Show directories for: Include files)
  2. Add Folder.png \Microsoft Platform SDK for Windows Server 2003 R2\Lib to the list of directories where the linker searches for libraries (Show directories for: Library files)

Visual Studio 2008 (VS9)

  • Install Visual Studio 2008 Professional or the free Express Edition
    • Express Edition also needs Windows SDK. After it is installed (SQL Server, .NET, Documentation and Solutions can be disabled) open MSVC and go to Tools -> Options -> Projects and Solutions:
  1. Folder.png \Microsoft SDKs\Windows\v6.1\Include to the list of directories where the compiler searches for headers (Show directories for: Include files)
  2. Folder.png \Microsoft SDKs\Windows\v6.1\Lib to the list of directories where the linker searches for libraries (Show directories for: Library files)

You also need FIFE Win32 DevKit. The latest version can be downloaded from download section.

Note: Microsoft SDKs need to be the same version of the windows the compilers were released for:

  • 5.x or 2003 for Visual Studio 2005
  • 6.x for Visual Studio 2008
  • 7.x for Visual Studio 2010 (unsupported)

Getting started

svn co http://fife.svn.cvsdude.com/engine/trunk
  • Unpack / install the FIFE Win32 DevKit to Folder.png <FIFE>\build\win32\
  • Download and install ActivePython 2.7

Building FIFE

  • Enter Folder.png <FIFE>\build\win32\ and run File.png update_project_files.bat to update the file list and generate the necessary SWIG wrappers for python. This step needs to be run every time you update to a new SVN revision to ensure that SWIG will always create working wrappers that are based on the latest code!
  • Open File.png fife_engine.sln
  1. Folder.png <FIFE>\build\win32\build_environments\visual_studio_8\ for Visual Studio 2005
  2. Folder.png <FIFE>\build\win32\build_environments\visual_studio_9\ for Visual Studio 2008
  • You can build FIFE now.

You should find the built dynamic library entitled File.png _fife.pyd in Folder.png <FIFE>\engine\python\fife. As a post build step the project will also copy File.png _fife.pyd to: Folder.png C:\Python26\Lib\site-packages\fife

Testing FIFE

Rio de hola

  • Move into the Folder.png <FIFE>\demos\rio_de_hola folder.
  • Start File.png run.py.

Note: OpenAL needs to be installed for sound (can be found in FIFE SDK)

Unit tests

In order to run (and debug) the unit tests in visual studio, a few extra steps need to be performed. But do note that this is completely optional, you will have a fully working FIFE even if you don't do this!

  • Run File.png <FIFE>\build\win32\build_environments\visual_studio_8\generate_unittests.py, this will create the solution and project files.
  • Open File.png <FIFE>\build\win32\build_environments\visual_studio_8\unit_tests\unit_tests.sln, this will start Visual Studio 2005.
  • Now, for each testprog_* project, edit its options by right-clicking on it.
    • "Configuration Properties->Debugging->Working Directory" should read $(TargetDir) for both configurations.
  • Build to make sure it compiles.
  • Copy all dll files from File.png <FIFE>\build\win32\binaries\msvc200X\*.dll to File.png <FIFE>\tests\core_tests
  • Now every project should pass its test even when started from within visual studio