Author Topic: Installing MinGW C++ compiler in Windows (for LaserBoy!)  (Read 4355 times)

0 Members and 1 Guest are viewing this topic.

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2088
  • Milliwatts: 46
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Installing MinGW C++ compiler in Windows (for LaserBoy!)
« on: February 18, 2013, 07:12:24 pm »
This is a step-by-step guild to setting up MinGW (GNU environment with GCC 4.7.2) in Windows, building and installing Boost-C++ 1.53.0, installing SDL 1.2.15, and Dev-C++ as a code editor.

Once all of this is done, it will be possible to double click on that comes with the current distribution of LaserBoy in the src directory and Dev-C++ will open the project ready to compile and link.

For this installation C:\ is assumed to be the root of your system drive.

Step one: Get your files!

Get the latest version of mingw-get-inst

Get the latest version of boost. It comes in several different compression platforms. You might as well get the Windows zip. This document assumes the current version is

Get the SDL development libraries. Look for the Windows MinGW version. It will be something like SDL-devel-1.2.15-mingw32.tar.gz.

Get Dev-C++ 5.0 beta 9.2 (, executable only (2.4 MB)
This application will never be updated. It's no longer being developed, but it is a nice C++ editor anyway. The MinGW system is the GNU GCC compiler.

And, of course, LaserBoy! Get the latest version here:


Start with the MinGW system. This will install a GNU like system inside of Windows. It provides a shell that behaves like BASH and a nice collection of commands and utilities.

Run the installer.
Choose the option to "Download latest repository catalogues".
Accept the agreement.
Accept the file location to be C:\MinGW at the root of a drive.
In the "Select Components" section, choose
  • C compiler
  • C++ compiler
  • MinGW Developer ToolKit.
Start the installation process. It takes a while!

After the installation is complete, go into your programs menu and open the MinGW shell. Doing this will create the home directory and add your current Windows login name to the MinGW system.

Navigate to the folder:

Copy the SDL development libraries archive file there.

From the MinGW shell, issue the following command to extract the archive file, while unzipping it, verbosely from the following named file.

tar -xzvf SDL-devel-1.2.15-mingw32.tar.gz

The shell has [Tab] key command completion, so you should just type up to the SDL part and hit tab for the rest, then [Enter] and wait for it to complete.

Now you can move the include files and the libs into the MinGW system.

Navigate to:


Select and cut all the files found in this folder that do not begin with '._' .

Navigate to:


Create a new directory there called SDL

Paste the above cut files in this folder:


Navigate to:


Select and cut all the files found in this folder that do not begin with '._' .

Navigate to and paste the above cut files in this folder:


The LaserBoy distribution comes with the runtime file SLD.dll version 1.2.15. If for some reason you need this file and you do not have LaserBoy, this file is found here:


You are now done installing SDL! You can delete the un-archived folder that you created in your MinGW home directory.

Now you must add the MinGW bin directory to your Windows system PATH statement so that Windows can find the executables located there.

Right click on (My) Computer and look in the Advanced tab for "Environment Variables". Click on that and notice the list called "System Variables". In that list will be one called 'Path'.

To the value of Path, add:


Make sure all the paths are separated with semicolons. Once you have added to the path and saved it, you might need to reboot Windows to load the new system path.

Building and installing Boost:

Unzip the boost sources you downloaded above directly at the root of your system drive.

You should get a folder that looks like:


Open the Windows command shell (not MinGW shell) and change the working directory to:


From there issue this command at the prompt:

build mingw

When it's done, it will have created a special compiler for Boost C++ called bjam.

In a file browser, navigate to:


Select and cut b2.exe and bjam.exe and paste them here:


In the Windows command shell, change directory to:


and issue the command

bjam --toolset=gcc link=static threading=single stage

and hit [Enter]. This can take a very long time!

When it's done, browse to this directory:


and cut or copy everything there and paste it here:


Then browse to:


and copy the whole 'boost' folder


This is to be copied or moved in whole to:


When this operation is done there should be a folder named


with all kinds of folders and *.h files in it.

At this point, you do not need anything in the folder


So you can delete the whole thing if you want.

INSTALL Dev-C++ editor:

Run the Dev-C++ 5.0 beta 9.2 ( installation file that you downloaded previously

Go with a full installation. Let it put itself in


The first time you run Dev-C++ it will probably tell you it cannot find 'make', but it found the MinGW version of make. That's fine!

Once Dev-C++ is installed and opened at least once, you should be able to double click on and open the LaserBoy project in Dev-C++, ready to examine, edit and compile.

When in Dev-C++,

[Ctrl] + F9

Is the keyboard shortcut to build the whole project.

If for some reason Dev-C++ cannot find the resources it needs from MinGW, from the Dev-C++ editing window, look in

    Compiler Options
        Directories [tab]

Within that dialog box make sure of the following:



C Includes

C++ Includes

Note: If the LaserBoy application is running when you try to link the executable, the linker will fail.
« Last Edit: March 02, 2013, 09:52:48 am by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2088
  • Milliwatts: 46
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: Installing MinGW C++ compiler in Windows (for LaserBoy!)
« Reply #1 on: January 21, 2019, 06:00:01 pm »

This all works on my old Windows XP 32-bit system (that is actually a clone of my laptop, running in Ubuntu + VMware Player 14).

I'm still looking into how to do this on a 64-bit Windows system.

You will need Winzip and 7zip to do this stuff.

Go here:

Get mingw-w64-install.exe

This is an internet installation app. It looks at your system and determines what you need to get. Mostly it looks for 32-bit or 64-bit systems.

When you install this, make life simple and have it install to C:\MinGW. Do not install it deep into your hard drive.

Once this is done, you can open a command prompt and navigate to C:\MinGW and run mingw-w64.bat

After that runs, it leaves you at C:\ but it put the MinGW bin in your path.

Leave the command prompt open and DL this:

If you are reading this way past the date it was written, you should look for the current version of boost C++.

Extract this directly on your C:\.

You will probably get a folder with a folder in it. What you want is to move the contents of the first folder that has stuff in it to C:\boost.

Now from your command prompt above, navigate to C:\boost.

run the command:
C:\boost\> bootstrap.bat gcc

This will take a while.

After this command returns, you need to run:

C:\boost\>  .\b2 --build-dir=C:\boost\build --toolset=gcc --variant=release --link=static --threading=single --runtime-link=static

This takes FOREVER.

So, go out. Get married. Have children. Get them prepared for life. Then come back and check the progress.

It isn't done until it's done.

After all that, you need to:

C:\boost\> .\b2 install

This also takes FOREVER.

Once it is all done, you need to move some files around. Open a file browser. Navigate to:


Select and cut the folder boost.

Navigate to:


and paste the folder boost that you just cut from above.

There's a lot of stuff, so it takes a while.

Then go back to:


Note this is not the libs directory.

You should see a whole mess of files that start with libboost...

Select all of them and cut.

Navigate to:


and paste everything you cut from above.

Now, you can delete the folder C:\boost\ and everything left in it.


Un-tar and unzip it directly to your C:\

Navigate to:


Select and cut the folder there called SDL

Navigate to:


and paste it there.

Go to C:\SDL-1.2.15\lib

Copy the three files there that do not begin with a dot.


Go to:


and paste them there.

Now from the same command prompt you used to compile boost, navigate to


Download (attached to this post). Put it inside of



C:\LaserBoy\src\> mingw32-make.exe -f

and wait for it.

Go to:


Find the file libwinpthread-1.dll select and copy it.

Go to C:\LaserBoy\

and paste it (in the same directory as LaserBoy.exe).

If all goes well you just successfully compiled LaserBoy.exe for 32-bit Windows.

Open a file browser to C:\LaserBoy and run LaserBoy.bat.

Edit this file to suit your screen resolution.

« Last Edit: January 22, 2019, 05:59:56 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!


SMF spam blocked by CleanTalk