Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 15 (modified by landauf, 8 years ago) (diff)

Windows with MinGW-w64 and GCC

CMake

Info: CMake is a build-system. It is used to generate make-files or project-files for IDEs

Download the latest binary release from here and install it.

  • While installing check the option to "add CMake to the system PATH"

MSYS2 and MinGW-w64

Info: MSYS2 is a command shell, used to execute build scripts and more.

Info: MinGW-w64 is a collection of tools (like GCC and more), used to compile source code on Windows. Despite its name it supports both 32bit and 64bit builds, depending on how you install it.

Download and install MSYS2 according to the the installation guide on this page: MSYS2 installer.

  1. Open the MSYS2 console and type "pacman -S make" to install make
  2. Install MinGW-w64:
    1. For 32bit-builds type "pacman -S mingw-w64-i686-gcc" in the MSYS2 console
    2. For 64bit-builds type "pacman -S mingw-w64-x86_64-gcc" in the MSYS2 console
  3. Close MSYS2 and open it again by using the correct shortcut (see the note below). Type "gcc --version" to find the version of gcc. Use this version later on to chose the correction dependency-package.

Note: MSYS2 installs three shortcuts:

  1. msys2_shell.bat: a neutral version that does not contain MinGW-w64 (not important for us)
  2. mingw32_shell.bat: adds the 32bit-installation of MinGW-w64 to $PATH (if installed) → use this for 32bit-builds
  3. mingw64_shell.bat: adds the 64bit-installation of MinGW-w64 to $PATH (if installed) → use this for 64bit-builds

You can install both versions of MinGW-w64 (32bit and 64bit) at the same time. You can determine which version to use by starting MSYS2 with the corresponding shortcut.

Switch to the home-directory of your MSYS2 installation: c:\<msys2-install-path>\home\<username>\
This is your homedirectory in MSYS2, this is where the action takes place.

In the following, we'll call this directory c:\<msys2-homedir>\ to make things shorter.

Note: It's also possible to install different versions of GCC. Follow the link on this page and install an independent version of MinGW-w64. Next go to /etc/fstab in MSYS2 and map the installation either to mingw32 or mingw64.

SVN

Info: We use SVN to upload code to the server and to manage different versions (branches).

Get SVN:

To use SVN? on your system we recommend TortoiseSVN, a very useful GUI-client. Download

TortoiseSVN is a shell extension. You can use it within Windows Explorer, which is very practical. Most options are available through the context menu (right mouse button).

Get the source:

Check out the Orxonox-repository into a folder named "trunk", for example c:\<msys2-homedir>\trunk\. It's very important to use a directory inside your MSYS2 homedirectory, otherwise you can't compile.

  • URL: https://svn.orxonox.net/game/code/trunk/
  • Checkout directory: c:\<msys2-homedir>\trunk\

Now do the same with the data repository and store it in a directoy called "data_extern":

  • URL: https://svn.orxonox.net/game/data/trunk
  • Checkout directory: c:\<msys2-homedir>\data_extern

Now you should have the following directories in your home:

c:\<msys2-homedir>\data_extern
c:\<msys2-homedir>\trunk

In TortoiseSVN this is done by right clicking into c:\<msys2-homedir>\ and chosing "SVN Checkout…". (see this picture)

Then set the URL of the repository to https://svn.orxonox.net/game/code/trunk/ and the checkout directory to c:\<msys2-homedir>\trunk\ (checkout depth should be "Fully recursive" and revision "HEAD"). Accept the certificate and enter your username and password in the authentication form (only if it's the first time you check out code from our server). (see this picture)

If you're not using TortoiseSVN, use the "svn co <repository> <directory>" command. See SVN? for more information.

Dependencies

Info: Dependencies are external libraries that aren't included in the orxonox source.

Go to the Download page and download the dependency package for MinGW-w64 that fits your version of GCC (type "gcc --version" in the MSYS2 console to find the installed version of GCC).
Extract the archive into c:\<msys2-homedir>\ (get 7-Zip here)

Now you should have the following directories in your home: (see this picture)

c:\<msys2-homedir>\data_extern
c:\<msys2-homedir>\dependencies
c:\<msys2-homedir>\trunk

Note: If someone is interested in building the dependencies on his own, the current build-scripts can be found here.

OpenAL:

Make sure you have installed OpenAL, which might not be shipped with Windows. Download and install it from here.

Build Orxonox

First we add an alias to the profile of MSYS2 which helps us creating make-files with CMake. Open the MSYS2 console and type the following lines:

echo alias cm=\'cmake .. -G \"MSYS Makefiles\"\' >> ~/.profile
source ~/.profile

Change into the trunk folder and create a build directory:

cd trunk
mkdir build
cd build

Now we use the alias "cm" we created before. This shortcut will invoke CMake and create the Makefiles. Type the following into the MSYS2 console:

cm
make -j8

The first command (cm) will check your system (and the dependency directory) for all needed libraries, create the configuration and generate the makefiles. The second command (make) builds Orxonox (-j8 will spawn 8 threads).

If you get an error while executing one of those steps, report it in the Forum or ask us in IRC.

Compiling will take some time (CMake shows you the percentage). Be patient.

See some pictures of this:

Run Orxonox

If everything worked fine, start Orxonox with c:\<msys2-homedir>\trunk\build\run.bat (you can't execute orxonox.exe directly).