Downloading and Compiling under Windows: Difference between revisions

From Arx Libertatis Wiki
Jump to navigation Jump to search
(Changed lib setup to use the ArxDependencies repository)
Line 45: Line 45:


== Get the code ==
== Get the code ==
In GitBash
In GitBash
  cd /c/Code/git
  cd /c/Code/git
  git clone git@github.com:lubosz/ArxFatalis.git
  git git://github.com/arx/ArxLibertatis.git
  cd ArxFatalis
  cd ArxFatalis
<b>Note:</b> If you have a previous checkout from the old repository URL you don't need to re-download the repo, you can just change the URL using <code>`git remote set-url origin git://github.com/arx/ArxLibertatis.git`</code>


== Generating VC++ projects ==
== Generating VC++ projects ==

Revision as of 13:31, 7 November 2011

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
  • DevIL
  • 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/ArxDependencies.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\ArxDependencies\zlib;C:\Code\git\ArxDependencies\freetype;C:\Code\git\ArxDependencies\devil;C:\Code\git\ArxDependencies\openal;C:\Code\git\ArxDependencies\boost;C:\Code\git\ArxDependencies\opengl;C:\Code\git\ArxDependencies\sdl;C:\Code\git\ArxDependencies\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\ArxDependencies\zlib;C:\Code\git\ArxDependencies\freetype;C:\Code\git\ArxDependencies\devil;C:\Code\git\ArxDependencies\openal;C:\Code\git\ArxDependencies\boost;C:\Code\git\ArxDependencies\opengl;C:\Code\git\ArxDependencies\sdl;C:\Code\git\ArxDependencies\directx

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

C:\Code\git\ArxDependencies\devil\bin\DevIL32.dll
C:\Code\git\ArxDependencies\devil\bin\DevIL64.dll
C:\Code\git\ArxDependencies\sdl\bin\SDL32.dll
C:\Code\git\ArxDependencies\sdl\bin\SDL64.dll

Get the code

In GitBash

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

Note: If you have a previous checkout from the old repository URL you don't need to re-download the repo, you can just change the URL using `git remote set-url origin git://github.com/arx/ArxLibertatis.git`

Generating VC++ projects

We'll use CMake for that

mkdir build_vc10
cd build_vc10
cmake .. -G "Visual Studio 10" -DARX_USE_UNITYBUILD=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