Skip to content

How to build on Windows with Visual Studio

Bernd Kosmahl edited this page Jun 30, 2023 · 1 revision

How to build on Windows with Visual Studio

This page describes how to build maxr under Windows using Visual Studio. For other platforms/compilers or general information see How to build.

Download and install the following tools:

  1. Visual Studio 2013 or newer. You can use the free community edition. https://www.visualstudio.com/downloads/download-visual-studio-vs
  2. CMake. Download the binary Windows Installer of the Latest Release. https://cmake.org/download
  3. A GIT client. We recommend using Sourcetree (http://www.sourcetreeapp.com/) or TortoiseGIT (https://code.google.com/p/tortoisegit/). But any other tool of your choice will do. Download the development packages of the following libraries, and extract them to a location of your choice (e.g. C:\libraries).

Build steps

  1. Get the maxr source code. You can use git to download (clone) the maxr source code from the following address: https://github.com/maxr-dot-org/maxr.git In Sourcetree, click the "Clone / New" button and enter the following information: Sourcetree_Clone
  2. Run cmake:
    • Select source directory e.g. C:\users\mechcommander\Documents\maxr
    • Select build directory e.g. C:\users\mechcommander\Documents\maxr\build
    • Configure (select generator Visual Studio "your version" Win64)
    • Set SDL paths: Cmake_Configure2
    • Cmake_Configure2
    • Configure again. Now you should see the message "Configuring done". If not, double check the entered SDL paths.
    • Generate
  3. Open Visual Studio project located at C:\users\mechcommander\Documents\maxr\build\maxr.sln
  4. Hit Build->Build Solution (F7)
  5. You will find the compiled executable at C:\users\mechcommander\Documents\maxr\build\Debug\maxr.exe or C:\users\mechcommander\Documents\maxr\build\Release\maxr.exe

Running/debugging your freshly compiled version of maxr

  1. In the Solution explorer window right click maxr and select Set as StartUp Project
  2. Set the correct working directory: Right click maxr again and select Properties. Now go to Configuration Properties->Debugging and set the working directory to the data folder. E. g. C:\users\mechcommander\Documents\maxr\data
  3. You can now start maxr with Debug->Start Debugging (F5) or Debug->Start without debugging (Ctrl+F5)
  4. Maxr will complain about missing DLLs. Copy the requested files to the directory which contains the maxr.exe. You can find the DLLs along with the libraries you installed in the beginning.