Skip to content

MinGW Build Tutorial

Nicholas "LB" Braden edited this page Oct 10, 2013 · 31 revisions

NOTICE: This tutorial is still under construction, and may be incomplete!

This tutorial teaches you how to:

  • Download and install MinGW
  • Download and install CMake
  • Download and build Boost (unless you have a 64-bit computer)
  • Download, build, and install SFML
  • Build and Run ChessPlusPlus

Installing MinGW for 32-bit Computers

MinGW, short for "Minimalist GCC for Windows", is a compiler for Windows based on the GCC compiler. If you have a 64-bit computer, skip this step and go to the step for 64-bit computers instead.

To start, download the MinGW installer from here:

http://sourceforge.net/projects/mingw/files/ "mingw-get-setup.exe"

Install the manager, and when the window opens, make sure you install at least these components:

Then, from the menu, choose "Installation" -> "Apply Changes", then click "Apply". Then, you just have to wait for everything to be downloaded and installed for you. While you wait, you can also read through later steps so you know what you're in for.

Once everything is installed, you can close the manager window. Next, we need to add MinGW to your system PATH variable. This is an advanced step and can be dangerous if you mess up, so be careful!

Open your start menu and right click on "Computer" and choose "Properties". On the left hand side of the window that opens, choose "Advanced System Settings". In the new window that opens, click the "Environment Variables..." button. Scroll down in the lower list to find the PATH variable:

Double-click it or click the "Edit..." button, then carefully, at the very beginning of the text, add a semi-colon, and then before the semi-colon, add the text "C:\MinGW\bin" without quotes. It will look similar to the screenshot above.

After this, click OK out of all the windows, and press WinKey+R - a "Run" dialog appears, type "cmd" wthout quotes and hit enter. A console window should appear - in this, type the following command and verify that you've done all the steps correctly up to now:

g++ --version

If your output is similar to the above, you've done everything correctly and can move on to the next step.

Installing MinGW for 64-bit Computers

This is significantly easier, since there is a distribution known as "nuwen MinGW" which has boost already included, among other things.

To download and install, simply download nuwen MinGW from here:

http://nuwen.net/mingw.html

After installation, you need to navigate to C:/MinGW/bin/ and find the file make.exe - copy and paste this, and rename the copy to mingw32-make.exe. This will allow CMake to recognize that you have MinGW installed.

Downloading & Installing CMake

CMake, short for "Cross-patform Make", is a tool that allows projects to easily be built with a multitude of compilers on a multitude of systems. You need CMake for both SFML and ChessPlusPlus.

Simply download and install the latest version of CMake:

http://www.cmake.org/cmake/resources/software.html (Look under "Binary Distributions" for Windows)

Downloading & Building Boost (32-bit only)

Note: skip this step entirely if you have a 64-bit computer.

Downloading & Building SFML

Note: you must perform this step whether you have 32 or 64 bit.

Clone this wiki locally