Building:Win32:VisualStudio

From FIFE development wiki

Jump to: navigation, search
Image:Xp-flag-32x32.png

Platform-dependent information: Win32.

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

Contents

Changes in progress...

[edit] Introduction

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

[edit] Requirements

[edit] Visual Studio 2005 (VS8)

  1. Add Image: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 Image: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)

[edit] 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. Image: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. Image: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)

[edit] Getting started

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

[edit] Building FIFE

  • Enter Image:Folder.png <FIFE>\build\win32\ and run Image: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 Image:File.png fife_engine.sln
  1. Image:Folder.png <FIFE>\build\win32\build_environments\visual_studio_8\ for Visual Studio 2005
  2. Image: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 Image:File.png _fife.pyd in Image:Folder.png <FIFE>\engine\python\fife. As a post build step the project will also copy Image:File.png _fife.pyd to: Image:Folder.png C:\Python26\Lib\site-packages\fife

[edit] Testing FIFE

[edit] Rio de hola

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

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

[edit] 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 Image:File.png <FIFE>\build\win32\build_environments\visual_studio_8\generate_unittests.py, this will create the solution and project files.
  • Open Image: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 Image:File.png <FIFE>\build\win32\binaries\msvc200X\*.dll to Image:File.png <FIFE>\tests\core_tests
  • Now every project should pass its test even when started from within visual studio
Personal tools