Downloading and Compiling under Windows: Difference between revisions
(Don't use fully-qualified URLs for wiki-internal links) |
(Spelling, grammar and layout improvements) |
||
Line 25: | Line 25: | ||
== Getting the libraries == | == Getting the libraries == | ||
Getting all libraries to work under Windows required a lot of work and was error prone... So we decided to provide pre-built versions (32-bit and 64-bit) to | Getting all libraries to work under Windows required a lot of work and was error prone... So we decided to provide pre-built versions (32-bit and 64-bit) to simplify the process. Arx Libertatis depends on the following libraries on Windows. | ||
Arx Libertatis depends on the following libraries on Windows. | |||
1. | * <code>SDL</code> 1.2.10 or newer, <code>SDL</code> 2 recommended (http://www.libsdl.org/) | ||
* <code>OpenGL</code> 1.5 or newer (http://www.opengl.org/) | |||
* <code>GLEW</code> 1.5.2 or newer (http://glew.sourceforge.net/) | |||
* <code>OpenAL</code> (OpenAL Soft is strongly recommended<sup>1</sup>: http://kcat.strangesoft.net/openal.html) | |||
* <code>zlib</code> (http://zlib.net/) | |||
* <code>Boost</code> 1.48 or newer (headers only <sup>1</sup>, http://www.boost.org/) | |||
* <code>GLM</code> 0.9.2.7 or newer (http://glm.g-truc.net/) | |||
* <code>FreeType</code> 2.3.0 or newer (http://www.freetype.org/) | |||
2. If you using the pre-built libraries from the | 1. The ArxWindows repo only contains the Boost source, it doesn't contain any prebuilt libraries - those aren't needed for AL. | ||
2. Creative's OpenAL implementation is severely limited, which can cause missing sounds in arx. OAL implementations from IHVs are just buggy and the cause for many crash reports. | |||
If you using the pre-built libraries from the ArxWindows repo, all of these should be included for you. | |||
'''Here's how to obtain them:''' | '''Here's how to obtain them:''' | ||
Line 46: | Line 47: | ||
git clone --depth 1 git://github.com/arx/ArxWindows.git | git clone --depth 1 git://github.com/arx/ArxWindows.git | ||
Then we need to tell cmake where to search for our libraries | Then we need to tell cmake where to search for our libraries: 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\glm;C:\Code\git\ArxWindows\libs\opengl;C:\Code\git\ArxWindows\libs\sdl;C:\Code\git\ArxWindows\libs\dbghelp | |||
On Windows 7 or later this can be done here:<br> [[File:Win7_env.png|400px]] | |||
After that, you need to start a new prompt (GitBash, Command Prompt, etc) so that the new environment variables are available. | |||
Run the following to check if you set the cmake path correctly or not: | |||
echo $CMAKE_PREFIX_PATH | 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\glm;C:\Code\git\ArxWindows\libs\opengl;C:\Code\git\ArxWindows\libs\sdl;C:\Code\git\ArxWindows\libs\dbghelp | |||
== Getting the source code == | == Getting the source code == |
Revision as of 06:21, 13 December 2014
ℹ️ 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.
This page documents how to compile Arx Libertatis from https://github.com/arx/ArxLibertatis under Windows.
There are also instructions available for Linux / FreeBSD and macOS
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 2012 or newer, given that you generate the right projects using CMake. Paths used here are only to give as an example...
Applications
- Visual C++ 2010 Express Edition: http://www.microsoft.com/express/Downloads/
- You can optionally install Visual Studio 2010 Service Pack 1: http://www.microsoft.com/express/Downloads/#2010-Service-Pack-1
- CMake: http://www.cmake.org/cmake/resources/software.html
- Make sure you add cmake to your PATH so that you can use it from the command line.
- For CMake installation guide, please visit http://johnlamp.net/cmake-tutorial-1-getting-started.html
- MinGW: http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst
- In the installer, make sure you check msys-base
- For MinGW installation guide, please visit http://ingar.satgnu.net/devenv/mingw32/base.html.
- msysgit: http://git-scm.com/downloads
- Optional: TortoiseGit: http://code.google.com/p/tortoisegit/
- Optional: Doxygen :http://www.stack.nl/~dimitri/doxygen/ for developer documentation
- Optional: Qt5: http://qt-project.org/wiki/Qt_5.0 for building crash reporters and profiler
- Profiler helps to determine why some frames are slower than others.
Getting the libraries
Getting all libraries to work under Windows required a lot of work and was error prone... So we decided to provide pre-built versions (32-bit and 64-bit) to simplify the process. Arx Libertatis depends on the following libraries on Windows.
SDL
1.2.10 or newer,SDL
2 recommended (http://www.libsdl.org/)OpenGL
1.5 or newer (http://www.opengl.org/)GLEW
1.5.2 or newer (http://glew.sourceforge.net/)OpenAL
(OpenAL Soft is strongly recommended1: http://kcat.strangesoft.net/openal.html)zlib
(http://zlib.net/)Boost
1.48 or newer (headers only 1, http://www.boost.org/)GLM
0.9.2.7 or newer (http://glm.g-truc.net/)FreeType
2.3.0 or newer (http://www.freetype.org/)
1. The ArxWindows repo only contains the Boost source, it doesn't contain any prebuilt libraries - those aren't needed for AL. 2. Creative's OpenAL implementation is severely limited, which can cause missing sounds in arx. OAL implementations from IHVs are just buggy and the cause for many crash reports.
If you using the pre-built libraries from the ArxWindows repo, all of these should be included for you.
Here's how to obtain them:
In GitBash
cd /c/Code/git git clone --depth 1 git://github.com/arx/ArxWindows.git
Then we need to tell cmake where to search for our libraries: 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\glm;C:\Code\git\ArxWindows\libs\opengl;C:\Code\git\ArxWindows\libs\sdl;C:\Code\git\ArxWindows\libs\dbghelp
On Windows 7 or later this can be done here:
After that, you need to start a new prompt (GitBash, Command Prompt, etc) so that the new environment variables are available.
Run the following to check if you set the cmake path correctly or not:
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\glm;C:\Code\git\ArxWindows\libs\opengl;C:\Code\git\ArxWindows\libs\sdl;C:\Code\git\ArxWindows\libs\dbghelp
Getting the source code
There are several methods to get the Arx Libertatis source code - choose the one that suits you best:
Downloading a released version
The easiest way to get the AL source code is to download a versioned release. This will get you a reasonably up to date copy of the source code that has been tested to work.
- Arx Libertatis Source Codearx-libertatis-1.2.tar.xz2.4 MiB
MD5:8e05754b75af0ed7fbf709d30b28df3c
signature
Cloning the repository
If you want the absolute latest version of the Arx Libertatis development code and stay up to date, you can clone the AL source code repository. Beware that this will give you the current master development branch that we are actively working on. While the code in that branch should always work, it hasn't undergone any significant testing. If you just want to play the game, consider using a released version instead.
To clone the repository, type:
git clone git://github.com/arx/ArxLibertatis.git
This creates a directory called ArxLibertatis and downloads the current source code from github.
Later if you want to update your local copy of the source code, run
git pull
The git repository does not contain raster images for the icon and logo. These will be generated from scalable versions when building Arx Libertatis, but doing so requires additional dependencies (Inkscape, ImageMagick and OptiPNG). To avoid this, you can instead get the generated images from the ArxLibertatisData repo:
git clone --depth 1 git://github.com/arx/ArxLibertatisData.git
Downloading a snapshot
Alternatively you can download the current snapshot of the source code repository as a .zip or .tar.gz file and extract that:
- Arx Libertatis Development Snapshot (tar.gz)latest snapshot of branch 'master'
- Arx Libertatis Development Snapshot (zip)latest snapshot of branch 'master'
This will give you the same code as cloning the repository, but won't let you update it without downloading everything again.
Generating VC++ projects
We'll use CMake for that In GitBash
mkdir build_vc10 cd build_vc10 cmake .. -G "Visual Studio 10" -DUNITY_BUILD=ON -DBUILD_PROFILER=OFF
- Note that here we need to disabled profiler. If you want to use both crash reporters and profiler, you need to install [Qt5 Application] (http://www.qt.io/download/)
- "Visual Studio 10" in the command refers to using Visual Studio 2010 to generate the project. If you are using Visual Studio 2012, use ""Visual Studio 11" instead. Use the following command to check the avaliable compilers on your computer.
cmake --help
- -DUNITY_BUILD=1 means to use Unity build.
- For further build options, please refer to readme under BUILD OPTION https://github.com/arx/ArxLibertatis/blob/master/README.md
Building ArxFatalis
- Build the whole solution (ArxLibertatis.sln) in Visual Studio: C:\Code\git\ArxLibertatis\build_vc10\ArxLibertatis.sln as shown in this picture:
- If you use Visual C++ 2010, there's a bug causing all cpp files to be place in the root of the project... it is annoying but has no effect on the build itself. See http://public.kitware.com/Bug/view.php?id=11925.
- You can build the debug target (has debug symbols & can be debugged) or the release target (faster, but currently without debug information)
Installing the data files
After getting the game data, you need to put the files in the correct location for AL to find them.
- By default, the Arx Liberatis search for data file (original game file) under the following three paths.
- C:\Code\git\ArxLibertatis\build_vc10 <--preferred
- C:\Code\git\ArxLibertatis\data\core
- C:\Users\[YOUR NAME]\Saved Games\Arx Libertatis
- So simply place your data file into one of the three directories.
- Finally, copy the necessary dlls to C:\Code\git\ArxLibertatis\build_vc10\Debug because that's where your arx.exe located
C:\Code\git\ArxWindows\libs\sdl\bin\SDL32.dll C:\Code\git\ArxWindows\libs\sdl\bin\SDL64.dll
The complete search path is described on the Data directories page.
Running ArxLibertatis
- Simply click on arx.exe under C:\Code\git\ArxLibertatis\build_vc10\Debug
Debugging ArxLibertatis
- 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