Spinning Topp Logo BlackTopp Studios
inc
Windows Development Tools

This is a walk-through that Sqeaky, MakoEnergy and HydroWolfy have made for so other people can use the same tools as them. If anyone cares to make Project files for Visual Studio, Eclipse or any other development platform please let us know your steps, and where possible please allow us to use a copy of the files.

The Core Tools

These are the main resources to get this working. You can most likely use different version of these tools and they will most likely work just fine. We recommend that you go to each of these sites and find the installation packages before continuing any further.

Dev Tool Alternatives

Installing

Like most windows installers you can get most of the work done by double clicking on it then ‘next’ until it is done. But thereare some specific option and extra steps you should be aware of.

MinGW32 Special configuration

During the installation of MinGW be sure to include the C++ compiler, MSYS Basic System and the MinGW Developer toolkit. This will include tool like Make and a Bash shell will be used by other tools later and may be useful if you want to dig into the gritty details.

MinGW32 and MinGW64 Special configuration

For some reason on Windows this compilers doesn’t work well with any spaces in its installation path. The default install directory is “c:\mingw” this works well most the time, but you can select any folder without spaces.

For the compiler to work correctly the system needs to made aware of it. The system PATH is a listing of folders that Windows (and most other operating systems) will search for programs when it is told run a program without being told its location. You can add it to just your current user’s PATH if you do not want to interfere with other users or to the system wide PATH if you think there will be other Mezzanine developers using the system. Here is how you add the minGW tools to windows PATH variable:

Window XP PATH Setup

  1. Right-click “My Computer” or “Computer”, click “properties”
  2. Click “Advanced” Tab
  3. Click “Environment Variables” Button
  4. Find the “PATH” variable and add “;C:\MinGW\bin” to the end (do not erase what is already in there, it will screw your computer)
  5. Click “OK” 3 times

Vista and Windows 7 PATH Setup

  1. Right-click “My Computer” or “Computer”, click “properties”
  2. Click “Advanced System Settings” Link
  3. If a UAC Prompt requests you permission to continue click “Continue”
  4. Click “Environment Variables” Button
  5. Find the “PATH” variable and add “;C:\MinGW\bin” to the end (do not erase what is already in there, it will screw your computer)
  6. Click “OK” 3 times

IDE Special configuration

Most development environments have some configuration that they require.

Code::Blocks – Using MinGW32

If you chose to use the version of Code::Blocks that came with the compiler you will still have to follow the instructions for editing the system PATH as listed above. The following steps assume you have installed MinGW64 to “C:\MinGW”. If you have it installed elsewhere, adjust the paths provided below accordingly.

Also, by default Code::Blocks looks for “make.exe” as it’s primary make program. MinGW doesn’t call it’s make executable “make.exe” though. So you will have to tell Code::Blocks to look for MinGW’s make executable. To do this:

  1. At the menu across the top, click “Settings” and go to “Compiler…”.
  2. In the window that appears, ensure the “Selected Compiler” is set to “GNU GCC Compiler”.
  3. Just below the “Selected Compiler”, there should be a row of tabs. Click on the “Toolchain Executables” tab.
  4. You should see a list of executables, and at the bottom of the list should have a box labeled “Make Program:”, with “make.exe” listed. To the right of that click the “…” button.
  5. Navigate to the “mingw32-make.exe” executable. This should be located in “C:\MinGW\bin”.
  6. Select the “mingw32-make.exe” executable and click “Open”. Then click “Ok” to close the configuration window

Code::Blocks – Using MinGW64

MinGW64 needs a bit more help when it comes with integration with Code::Blocks. Ensure the MinGW64 install location has been added to the system PATH before proceeding. The following steps assume you have installed MinGW64 to “C:\MinGW”. If you have it installed elsewhere, adjust the paths provided below accordingly.

  1. At the menu across the top, click “Settings” and go to “Compiler…”.
  2. In the window that appears, ensure the “Selected Compiler” is set to “GNU GCC Compiler”.
  3. In the “Compiler Settings” tab, select the “Other options” sub-tab and then enter “-m64”. This will force 64-bit builds. Entering “-m32” will force 32-bit builds.
  4. In the “Search directories” tab, select the “Compiler” sub-tab and enter the following 3 directories: “C:\MinGW\include”, “C:\MinGW\x86_64-w64-mingw32\include”, and “C:\MinGW\lib\gcc\x86_64-w64-mingw32\4.8.1\include”.
  5. Still in the “Search directories” tab, select the “Linker” sub-tab and enter the following 2 directories: “C:\MinGW\lib” and “C:\MinGW\x86_64-w64-mingw32\lib”.
  6. In the “Toolchain executables” tab, ensure the “Compiler’s installation directory” is set properly (for example “C:\MinGW”).
  7. In the “Toolchain executables” tab, most of the executables defined have to be changed. Use the quoted text below to set each executable appropriately:
    C Compiler:  x86_64-w64-mingw32-gcc.exe
    C++ Compiler:  x86_64-w64-mingw32-g++.exe
    Linker for dynamic libs: x86_64-w64-mingw32-g++.exe
    Linker for static libs:  ar.exe
    Debugger:  GDB/CDB debugger : Default
    Resource compiler:  windres.exe
    Make Program:  mingw32-make.exe
    

Qt Creator

For the debugger to work with any compiler make sure that the “CMAKE_BUILD_TYPE” option in Cmake is set too “Debug”. Additionally, some versions of the microsoft compiler do not come with a debugger. Be sure to install a copy of the windows software development kit if you are using some version of Visual Studio for the compiler.

Visual Studio

In theory this should just work. In practice we have only shown that this can be used to compile the source. There hasn’t been thorough testing of game compilation, bug parity or build configuration options.

Git Special configuration

When installing you will be asked where you will want to use the git tools from. This again, works with the system PATH. Use the default settings. If you select an option that puts the msys git tools into the windows path, it will conflict with cmake. Git can go into your PATH, but its tools cannot.

Git Push

If you plan on making pushes to Github.com you will need to configure an account and an ssh key with them. From the git bash command prompt you can type “ssh-keygen” to make a set of keys. Alternatively if you are using the Git Gui installed with msysgit, with a repo opened you can go to the “Help” pulldown menu at the top of the window, then “Show SSH Key”. This will open a new small window that should have a “Generate Key” button in the top right corner, and a “Copy to Clipboard” button in the bottom left corner.

You will need to copy your public sshkey into your Github profile. When creating your keypair, let it use the default location to save your keys. That way you won’t have to configure git with the locations. It will output the location of the file, and you can open it notepad/wordpad or any text editor and copy/paste into the webpage.

During your first clone/pull of the repository you will want to verify the authenticity of the ssh servers RSA fingerprint, which can be found in Github’s documentation , as well as a more detailed explanation of the key creation process.

CMake Special configuration

During the Installation you will be asked about the system PATH . even though it is not strictly required, it can be useful to set CMake to be in the path for the current user (or all users if other will develop software). This will simplify the running of command line commands and enable you to copy/paste commands published by others. This is an option you will be presented during the installation.

Other Tools

Currently these tools aren’t required, but they are popular and you might find them useful.

What’s next

If you aren’t comfortable with your codings skills C++ Training and Tools is a good idea. If you are comfortable with you coding skill and have the tools installed check out the Mezzanine Engine Dependencies, if you already have what you need from that you could take a look at what it takes for Building The Engine.