Downloading and Compiling under Windows: Difference between revisions

From Arx Libertatis Wiki
Jump to navigation Jump to search
(DevIL is no more a dependency)
Line 16: Line 16:
Arx Libertatis depends on the following libraries on Windows. Those followed by an asterisk are optional; depending on which backend you want to use they might not be needed.
Arx Libertatis depends on the following libraries on Windows. Those followed by an asterisk are optional; depending on which backend you want to use they might not be needed.
* Boost - ArxWindows only contains the Boost source, it doesn't contain any prebuilt libraries. You'll either have to build them yourself, or grab them from http://boost.teeks99.com/
* Boost - ArxWindows only contains the Boost source, it doesn't contain any prebuilt libraries. You'll either have to build them yourself, or grab them from http://boost.teeks99.com/
* DevIL with support for <code>BMP</code>, <code>JPEG</code> and <code>TGA</code>
* DirectX SDK (*)
* DirectX SDK (*)
* FreeType
* FreeType
Line 33: Line 32:
Then we need to tell cmake where to search for our libs
Then we need to tell cmake where to search for our libs
* Add CMAKE_PREFIX_PATH to your environment variable:
* Add CMAKE_PREFIX_PATH to your environment variable:
** CMAKE_PREFIX_PATH=C:\Code\git\ArxWindows\libs\zlib;C:\Code\git\ArxWindows\libs\freetype;C:\Code\git\ArxWindows\libs\devil;C:\Code\git\ArxWindows\libs\openal;C:\Code\git\ArxWindows\libs\boost;C:\Code\git\ArxWindows\libs\opengl;C:\Code\git\ArxWindows\libs\sdl;C:\Code\git\ArxWindows\libs\directx
** CMAKE_PREFIX_PATH=C:\Code\git\ArxWindows\libs\zlib;C:\Code\git\ArxWindows\libs\freetype;C:\Code\git\ArxWindows\libs\openal;C:\Code\git\ArxWindows\libs\boost;C:\Code\git\ArxWindows\libs\opengl;C:\Code\git\ArxWindows\libs\sdl;C:\Code\git\ArxWindows\libs\directx
*** if on windows 7 then here: http://arx.parpg.net/File:Win7_env.png
*** if on windows 7 then here: http://arx.parpg.net/File:Win7_env.png
* After that, you need to start a new prompt (GitBash, Command Prompt, etc) so that the new environment variable is available
* After that, you need to start a new prompt (GitBash, Command Prompt, etc) so that the new environment variable is available
* Start a new GitBash instance
* Start a new GitBash instance
** Run the following: echo $CMAKE_PREFIX_PATH
** Run the following: echo $CMAKE_PREFIX_PATH
** It should echo: C:\Code\git\ArxWindows\libs\zlib;C:\Code\git\ArxWindows\libs\freetype;C:\Code\git\ArxWindows\libs\devil;C:\Code\git\ArxWindows\libs\openal;C:\Code\git\ArxWindows\libs\boost;C:\Code\git\ArxWindows\libs\opengl;C:\Code\git\ArxWindows\libs\sdl;C:\Code\git\ArxWindows\libs\directx
** It should echo: C:\Code\git\ArxWindows\libs\zlib;C:\Code\git\ArxWindows\libs\freetype;C:\Code\git\ArxWindows\libs\openal;C:\Code\git\ArxWindows\libs\boost;C:\Code\git\ArxWindows\libs\opengl;C:\Code\git\ArxWindows\libs\sdl;C:\Code\git\ArxWindows\libs\directx


Finally, copy the necessary dlls to C:\Code\git\ArxFatalis\bin\...
Finally, copy the necessary dlls to C:\Code\git\ArxFatalis\bin\...
C:\Code\git\ArxWindows\libs\devil\bin\DevIL32.dll
C:\Code\git\ArxWindows\libs\devil\bin\DevIL64.dll
  C:\Code\git\ArxWindows\libs\sdl\bin\SDL32.dll
  C:\Code\git\ArxWindows\libs\sdl\bin\SDL32.dll
  C:\Code\git\ArxWindows\libs\sdl\bin\SDL64.dll
  C:\Code\git\ArxWindows\libs\sdl\bin\SDL64.dll

Revision as of 02:40, 9 August 2012

ℹ️  This page describes compiling Arx Libertatis from source under Windows and assumes some familiarity with the command-line. If you just want to play the game, it might be easier to grab a binary release or snapshot if available.

Here's a quick guide describing how to compile and debug Arx Fatalis under Windows using Visual Studio 2010. It should also work using Visual Studio 2008, given that you generate the right projects using CMake. Paths used here are only to give as an example...

Applications

Getting the libs

Getting all libraries to work under Windows required a lot of work and was error prone... So we decided to provide prebuilt versions (32-bit and 64-bit) to simply the process. Arx Libertatis depends on the following libraries on Windows. Those followed by an asterisk are optional; depending on which backend you want to use they might not be needed.

  • Boost - ArxWindows only contains the Boost source, it doesn't contain any prebuilt libraries. You'll either have to build them yourself, or grab them from http://boost.teeks99.com/
  • DirectX SDK (*)
  • FreeType
  • OpenAL (*)
  • OpenGL (*)
  • GLEW (*)
  • SDL (*)
  • ZLib

Here's how to obtain them.

In GitBash

cd /c/Code/git
git clone git://github.com/arx/ArxWindows.git

Then we need to tell cmake where to search for our libs

  • Add CMAKE_PREFIX_PATH to your environment variable:
    • CMAKE_PREFIX_PATH=C:\Code\git\ArxWindows\libs\zlib;C:\Code\git\ArxWindows\libs\freetype;C:\Code\git\ArxWindows\libs\openal;C:\Code\git\ArxWindows\libs\boost;C:\Code\git\ArxWindows\libs\opengl;C:\Code\git\ArxWindows\libs\sdl;C:\Code\git\ArxWindows\libs\directx
  • After that, you need to start a new prompt (GitBash, Command Prompt, etc) so that the new environment variable is available
  • Start a new GitBash instance
    • Run the following: echo $CMAKE_PREFIX_PATH
    • It should echo: C:\Code\git\ArxWindows\libs\zlib;C:\Code\git\ArxWindows\libs\freetype;C:\Code\git\ArxWindows\libs\openal;C:\Code\git\ArxWindows\libs\boost;C:\Code\git\ArxWindows\libs\opengl;C:\Code\git\ArxWindows\libs\sdl;C:\Code\git\ArxWindows\libs\directx

Finally, copy the necessary dlls to C:\Code\git\ArxFatalis\bin\...

C:\Code\git\ArxWindows\libs\sdl\bin\SDL32.dll
C:\Code\git\ArxWindows\libs\sdl\bin\SDL64.dll

Get the code

In GitBash

cd /c/Code/git
git clone git://github.com/arx/ArxLibertatis.git
cd ArxLibertatis

Alternatively you can download a stable source code release and extract that:

Generating VC++ projects

We'll use CMake for that

mkdir build_vc10
cd build_vc10
cmake .. -G "Visual Studio 10" -DUNITY_BUILD=1

Building ArxFatalis

  • Open the solution in Visual Studio: C:\Code\git\ArxFatalis\build_vc10\ArxFatalis.sln
  • You can build the debug target (has debug symbols & can be debugged) or the release target (faster, but currently without debug information)

Debugging ArxFatalis

  • Right click on the arx project and select "Properties..."
  • Go to "Configuration Properties->Debugging"
  • Change the "Working Directoy" property to "..\bin"
    • Note that this needs to be done for each target you wish to build/debug
  • Change full_screen to 0 in bin\cfg.ini, as debugging with a fullscreen dx windows is a pain
  • Click the "debug" button (F5) and enjoy :D