Building:Win32:VisualStudio
Platform-dependent information: Win32.
The following passage contains information that is specific to Windows operating systems.
Introduction
This guide describes how to build FIFE with Microsoft Visual Studio and the Win32 DevKit.
Requirements
Visual Studio 2005 (VS8)
- Install Visual Studio 2005 Professional or the free Express Edition
- Upgrade it to Service Pack 1 - professional SP1 & MSVC 2005 EE SP1
- Express Edition also needs platform SDK. After it is installed open MSVC and go to Tools -> Options -> Projects and Solutions:
- Add
\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)
- Add
\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)
- Add
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:
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
- Checkout the latest sources from the Subversion repository
svn co http://fife.svn.cvsdude.com/engine/trunk
- Unpack / install the FIFE Win32 DevKit to
<FIFE>\build\win32\
- Download and install ActivePython 2.7
Building FIFE
- Enter
<FIFE>\build\win32\ and run
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
fife_engine.sln
<FIFE>\build\win32\build_environments\visual_studio_8\ for Visual Studio 2005
<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
_fife.pyd in
<FIFE>\engine\python\fife. As a post build step the project will also copy
_fife.pyd to:
C:\Python26\Lib\site-packages\fife
Testing FIFE
Rio de hola
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
<FIFE>\build\win32\build_environments\visual_studio_8\generate_unittests.py, this will create the solution and project files.
- Open
<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
<FIFE>\build\win32\binaries\msvc200X\*.dll to
<FIFE>\tests\core_tests
- Now every project should pass its test even when started from within visual studio