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 LaserBoy.dev 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
http://sourceforge.net/projects/mingw/files/Installer/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 boost_1_53_0.zip.
http://www.boost.org/Get the SDL development libraries. Look for the Windows MinGW version. It will be something like SDL-devel-1.2.15-mingw32.tar.gz.
http://www.libsdl.org/download-1.2.phpGet Dev-C++ 5.0 beta 9.2 (4.9.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.
http://www.bloodshed.net/dev/devcpp.htmlAnd, of course, LaserBoy! Get the latest version here:
http://laserboy.org/forum/index.php?topic=10.0INSTALLATION:
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:
C:\MinGW\msys\1.0\home\[your_windows_name]
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:
C:\MinGW\msys\1.0\home\[your_windows_name]\SDL-1.2.15\include\SDL
Select and cut all the files found in this folder that do not begin with '._' .
Navigate to:
C:\MinGW\include\
Create a new directory there called SDL
Paste the above cut files in this folder:
C:\MinGW\include\SDL
Navigate to:
C:\MinGW\msys\1.0\home\[your_windows_name]\SDL-1.2.15\lib
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:
C:\MinGW\lib
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:
C:\MinGW\msys\1.0\home\[your_windows_name]\SDL-1.2.15\bin\SDL.dll
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:
C:\MinGW\bin
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:
C:\boost_1_53_0
Open the Windows command shell (not MinGW shell) and change the working directory to:
C:\boost_1_53_0\tools\build\v2\engine
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:
C:\boost_1_53_0\tools\build\v2\engine\bin.ntx86
Select and cut b2.exe and bjam.exe and paste them here:
C:\boost_1_53_0\
In the Windows command shell, change directory to:
C:\boost_1_53_0\
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:
C:\boost_1_53_0\stage\lib
and cut or copy everything there and paste it here:
C:\MinGW\lib
Then browse to:
C:\boost_1_53_0
and copy the whole 'boost' folder
C:\boost_1_53_0\boost
This is to be copied or moved in whole to:
C:\MinGW\include
When this operation is done there should be a folder named
C:\MinGW\include\boost
with all kinds of folders and *.h files in it.
At this point, you do not need anything in the folder
C:\boost_1_53_0
So you can delete the whole thing if you want.
INSTALL Dev-C++ editor:
Run the Dev-C++ 5.0 beta 9.2 (4.9.9.2) installation file that you downloaded previously
Go with a full installation. Let it put itself in
C:\Dev-Cpp\
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 LaserBoy.dev 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
Tools
Compiler Options
Directories [tab]
Within that dialog box make sure of the following:
Binaries
C:\MinGW\bin
Libraries
C:\MinGW\lib
C Includes
C:\MinGW\include
C++ Includes
C:\MinGW\include
Note: If the LaserBoy application is running when you try to link the executable, the linker will fail.