Compile on windows - secure411dotorg/mal4s GitHub Wiki


=== ###Mal4s is now available as a Windows binary

Mal4s Windows Installer - Automatic File Type Association


##Compilers and tools:

Git for Windows

Winzip

Python Get the latest stable version (2.7.6 Presently)

MINGW/MSYS It allows the use of unix commands in a Windows shell. It is not the same as a Linux environment, but takes the Windows command prompt closer to POSIX environment. From the basic setup, install everything.

The recommended IDE can be downloaded from Code Blocks project. Version 13.12 direct Do not get the version with MinGW bundled. The IDE only version will be able to search for MinGW after installation.

Add the compiler and tools to the path. This is done from the system properties->Advanced system settings->Environment Variables in the system variables section.C:\MinGW\bin;C:\MinGW\msys\1.0\bin. Adding those two paths to the end of the PATH variable should make compiling much easier. Adding msys tools to the path is optional will allow the use of many of the unix tools from the Windows shell as well. It is my preference to add it to the path, but it is not a must.

###Libraries

SDL2 - Development Library for mingw, SDL2_image - Development Library for mingw, SDL2_mixer - Development Library for mingw Extract the include, and lib directories and the contents of bin from i686-w64-mingw32 to C:\MinGW\.

PCRE - Developer Files and Binary From the developer files archive, extract lib and include directories into C:\MinGW\. Only the pcre3.dll and pcreposix3.dll files will be needed from the binary archive, place them in C:\MinGW\.

Freetype2 Binary Place the freetype6.dll from bin in C:\MinGW\, and extract lib and include to C:\MinGW\.

GLM header only library Open the archive and place the whole glm subdirectory (glm under glm) in C:\MinGW\include

GLEW Extract the include directory to C:\MinGW\, put the files from lib\Release\Win32 in C:\MinGW\lib, and place glew32.dll from bin\Release\Win32 in C:\MinGW\

Boost Libraries Extract the whole archive in C:\. Open a Windows command prompt

cd C:\boost_1_55_0
bootstrap.bat gcc
b2 toolset=gcc variant=debug,release link=static,shared threading=multi --with-filesystem --with-system # Note "install" is supposed to be the target, but for some reason it will not build that way

The filesystem lib and system lib are required to build mal4s must be moved from C:\boost_1_55_0\bin.v2\libs\filesystem\build\gcc-mingw-4.8.1\release\link-static\threading-multi\ C:\boost_1_55_0\bin.v2\libs\system\build\gcc-mingw-4.8.1\release\link-static\threading-multi\ to C:\MinGW\lib and C:\boost_1_55_0\boost must be moved into C:\MinGW\include. NOTE: If you try to follow the intructions from the boost web site, many of the steps fail. Do this minimal build to save yourself the frustration.

###Clone the mal4s repository

Open a git bash prompt in C:\, then

git clone https://github.com/secure411dotorg/mal4s.git
cd mal4s
git submodule init
git submodule update

Copy/move all the dll files in C:\MinGW to C:\mal4s.

###Configure the Code::Blocks IDE

From the Settings->Compiler... Under Global compiler settings, select the Search directories tab, the compiler search directories should be:

C:\MinGW\include
C:\MinGW\include\SDL2
C:\MinGW\include\freetype2

The linker search directory should be c:\MinGW\lib

###Compile

Open the mal4s Code::Blocks project file included in the repository and click build.

If you used a different version of one of the libraries, there may be additional modifications needed to the project, such as a different version of boost. To edit the linked libraries: Project->Build options, make sure the Mal4s is selected and not default, then select the Linker settings tab, that is where the libraries are. The name of the library files for boost will change depending on the build of MinGW and boost version.