Compiling the scripting fork on Windows with MinGW, and Code::Blocks

From Secret Maryo Chronicles Wiki
Jump to: navigation, search

This is a guide for compiling Secret Maryo Chronicles on Windows with MinGW and Code::Blocks. It was written and tested on Windows 7 32-bit SP1.

Contents

Setting up MinGW

Get mingw-get-setup.exe from MinGW's files section and run it. Install MinGW to C:\MinGW.

Choose the following packages during installation: mingw-developer-toolkit, mingw32-base, mingw32-gcc-g++ and msys-base.

After installation is complete, create folder libs under C:\MinGW.

Setting up Code::Blocks

Get codeblocks-12.11-setup.exe from Code::Blocks' download page - we DON'T want the one which bundles a MinGW distribution.

Install Code::Blocks.

Setting up Ruby

Get the rubyinstaller-1.9.3-p448.exe installer from RubyInstaller's download page.

Install Ruby to C:\Ruby193.

Setting up CMake

Download the Windows ZIP distribution of CMake (cmake-2.8.12-win32-x86.zip) from CMake's download page. Extract it, rename the cmake-2.8.12-win32-x86 folder to CMake, and copy it to the root of C:\ such that the executable files are in C:\CMake\bin.

Preparing for compiling

Dependencies

SDL

Get SDL-devel-1.2.15-mingw32.tar.gz from SDL's historic download page. Also get SDL_image 1.2.12, SDL_mixer 1.2.12 and SDL_ttf 2.0.11.

Put the bin/include/lib folders under C:\MinGW\libs\SDL-1.2.15.

Boost

Get boost_1_54_0.7z from Boost's files section and extract it to C:\MinGW\libs. After it's done extracting, rename the extracted folder boost_1_54_0 to boost-1.54.0.

Run cmd.exe to open a command prompt and run the following commands:

SET PATH=C:\MinGW\bin;%PATH%
SET BOOST_ROOT=C:\MinGW\libs\boost-1.54.0
cd %BOOST_ROOT%\tools\build\v2\
bootstrap.bat gcc
b2 toolset=gcc install --prefix=%BOOST_ROOT%\b2
cd %BOOST_ROOT%
b2\bin\b2 -j %NUMBER_OF_PROCESSORS% -a toolset=gcc --with-chrono --with-date_time --with-filesystem --with-system --with-thread --with-timer link=shared runtime-link=shared threading=multi threading=multi variant=debug,release --stagedir=%BOOST_ROOT%

Now take a look at C:\MinGW\libs\boost-1.54.0\lib - the .dll.a import libraries (for linking) and the DLLs (for distribution) should be there.

CEGUI

Get Crazy Eddie's GUI System 0.7.9 source code (.zip file) and CEGUI 0.7.x-r1 precompiled dependencies for MinGW (.zip file) (experimental / unsupported) from the CEGUI 0.7.9 page.

Extract CEGUI-0.7.9.zip to C:\MinGW\libs. When it's done, extract CEGUI-DEPS-0.7.x-r1-mingw.zip to C:\MinGW\libs\CEGUI-0.7.9. You should now have all dependencies under C:\MinGW\libs\CEGUI-0.7.9\dependencies.

Edit C:\MinGW\libs\CEGUI-0.7.9\projects\premake\config.lua and paste the following contents:

--
-- CEGUI premake configuration script
--

--- These control whether certain build configurations will be available in the
--- generated solutions.  You can set to false (or comment) any build configs
--- you will not be using.
WANT_RELEASE_WITH_SYMBOLS_BUILD = false
WANT_STATIC_BUILD = false

--- This controls which version of the C/C++ runtime and which version of the
--- dependencies are used when linking the static build configurations.
---
--- false: use the static c/c++ runtime option and the 'static' dependencies.
--- true: use the DLL c/c++ runtime option and the 'dynamic' dependencies.
STATIC_BUILD_WITH_DYNAMIC_DEPS = false

-- comment this to disable debug suffixes for dynamic module dlls
-- if you want to use another suffix, just change the string :)
-- all the debug cegui libraries are built with this suffix
DEBUG_DLL_SUFFIX = "_d"

-- Iterator debugging setting
--
-- This controls the level of debugging and other checks done for STL iterators
-- in the debug build for the MSVC++ compilers.
-- Setting this to false can improve performance of debug builds at the expense
-- of safety / debug checks on iterators.
FULLY_CHECKED_DEBUG_ITERATORS = true

-- SDK / dependency paths
-- { base, include_suffix, library_suffix }
-- base can be absolute or relative to the root cegui_mk2 dir
IRRLICHT_PATHS = { "irrlicht-1.7.1", "include", "lib/Win32-visualstudio" }
OGRE_PATHS = { "C:/OgreSDK", "include", "lib" }
OIS_PATHS = { "C:/OgreSDK", "include/OIS", "lib" }
-- Set this to where your RapidXML package headers are to be found
RAPIDXML_PATHS = { "rapidxml-1.13", "", "" }

-- Python / boost::python (required to build python extension modules)
PYTHON_PATHS = { "C:/Python26", "include", "libs" }
BOOST_PYTHON_PATHS = { "C:/Program Files/boost/boost_1_44", "", "lib" }


-- Extra SDK / dependency paths.
--
-- Here you can set up any additional paths you require for the various projects
-- in CEGUI.  This is useful if, for example, you are using some SDK that has
-- additional external dependencies of it's own (for example, boost used with
-- Ogre).  All you need to do is add an entry in the following table to indicate
-- the base directory, include sub-directory, library-subdirectory, and optionally
-- the name of the CEGUI project to add the paths to (if no project is given, the
-- paths are added to /all/ projects).
--
-- NB: Each entry should be surrounded by curly braces, with each entry
-- separated with a comma and appearing within the existing braces.
--
-- For example, to add the OgreSDK boost paths to build for the Ogre renderer
-- module and sample helper with Ogre support, you might have:
--
-- CEGUI_EXTRA_PATHS = {
--     { "../OgreSDK/boost_1_42", "", "lib", "CEGUIOgreRenderer" },
--     { "../OgreSDK/boost_1_42", "", "lib", "CEGUISampleHelper" }
-- }
--
CEGUI_EXTRA_PATHS = {
}

--- Irrlicht SDK Version
--- 14 is means 1.4 or 1.5.x and 16 means 1.6 or 1.7.x (and above?)
CEGUI_IRR_SDK_VERSION = 16

--- OIS API version to be used in the Ogre samples base app.
--- true: use older numKeyboards / numMice
--- false: use getNumberOfDevices
CEGUI_OLD_OIS_API = false

--- Lua version
--- 51 is 5.1 (and above?) From 0.7.0 onwards, lua 5.0 is no longer supported.
CEGUI_LUA_VER = 51

--- Freetype library
--- CEGUI uses the freetype library for some of it's font support.  To disable
--- the use of freetype, set this to false.
CEGUI_USE_FREETYPE = true

--- PCRE library
--- CEGUI uses the pcre library for it's regular expression based string
--- validation as used in the Editbox (and derived classes, such as Spinner).
--- To disable the use of PCRE (and therefore the validation factilities), set
--- this to false.  (Attempts to set validation string will throw).
CEGUI_USE_PCRE_REGEX = true

--- CEGUI::DefaultLogger
--- To disable compilation and use of the CEGUI::DefaultLogger, set this to
--- false.
---
--- Note: If you disable this, you MUST provide an alternative CEGUI::Logger
--- based class and instantiate it before creating the main CEGUI::System object.
CEGUI_USE_DEFAULT_LOGGER = true

--- BiDirectional text support.
--- To enable support for bi-directional text in CEGUI, set CEGUI_BIDI_SUPPORT
--- to true.
--- With bidirectional support enabled, CEGUI_USE_MINIBIDI then controls whether
--- that support is provided viaan embedded copy of minibidi (true) or an
--- external copy of the fribidi library (false).
CEGUI_BIDI_SUPPORT = false;
CEGUI_USE_MINIBIDI = true;

--- MinizipResourceProvider
--- To enable compilation and inclusion into CEGUIBase of the MinizipResourceProvider
--- set the following to true.
---
--- The MinizipResourceProvider enables resources to be loaded from a zip compressed
--- archive.
MINIZIP_RESOURCE_PROVIDER = true

-------------
-- Renderers
-- this controls which renderer modules are built
OPENGL_RENDERER = true
DIRECT3D9_RENDERER = false
DIRECT3D10_RENDERER = false
DIRECT3D11_RENDERER = false
IRRLICHT_RENDERER = false
OGRE_RENDERER = false
NULL_RENDERER = true

----------------
-- Image Codecs
-- this controls which image codecs are built
TGA_IMAGE_CODEC = false
SILLY_IMAGE_CODEC = false
DEVIL_IMAGE_CODEC = false
FREEIMAGE_IMAGE_CODEC = true
CORONA_IMAGE_CODEC = false
STB_IMAGE_CODEC = false

-- this setting selects the default image codec module
-- can be either "tga", "silly", "devil", "freeimage", "stb" or "corona"
-- SILLY was written for CEGUI
DEFAULT_IMAGE_CODEC = "freeimage"

---------------
-- Window Renderers
-- controls window renderers built
FALAGARD_WR = true

-- default WR
-- available: falagard
DEFAULT_WINDOW_RENDERER = "falagard"




---------------
-- XML parsers
-- this controls which xml parser modules are built
EXPAT_PARSER = true
XERCES_PARSER = false
TINYXML_PARSER = false
RAPIDXML_PARSER = false
LIBXML_PARSER = false

-- this selects the default XML parser module
-- can be either "expat", "xerces", "tinyxml", "rapidxml" or "libxml"
DEFAULT_XML_PARSER = "expat"


-------
-- Lua
-- this controls whether CEGUILua is enabled
LUA_SCRIPT_MODULE = true

-- disable this for a smaller and faster, but less safe Lua module
-- only affects Release builds. Debug and ReleaseWithSymbols always
-- enable this
LUA_SCRIPT_MODULE_SAFE = false

-- enable this to build the bundled tolua++ as a static library
TOLUA_STATIC = false


-------
-- Python
-- this controls whether building the Python extension modules is enabled
PYTHON_EXTENSION_MODULE = false


-----------
-- Samples
-- remember you have to edit CEGUISamplesConfig.h as well this just controls
-- dependencies etc. if the renderer is disabled this has no effect
SAMPLES_GL = false
SAMPLES_DX9 = false
SAMPLES_DX10 = false
SAMPLES_IRRLICHT = false
SAMPLES_OGRE = false

-- this setting controls if the samples should be included in the same
-- solution as the core libraries. If this setting is disabled you can
-- still generate a seperate solution for the samples
--
-- due to a missing feature in premake enabling this will cause the
-- output files to be placed in cegui_mk2/bin and not cegui_mk2/Samples/bin
--
SAMPLES_INCLUDED = false

Run cmd.exe to open a command prompt and run these commands:

SET PATH=C:\MinGW\bin;%PATH%
cd C:\MinGW\libs\CEGUI-0.7.9\projects\premake
premake --file cegui.lua --target cb-gcc

You should now have a new file in C:\MinGW\CEGUI-0.7.9\projects\premake : CEGUI.workspace.

Open CEGUI.workspace in Code::Blocks. The CEGUI workspace should have a number of projects under it, and CEGUIBase should be the active project.

Right-click CEGUIBase and choose Build options.... In the dialog that appears, click the CEGUIBase target (the root of the target tree), then the Linker settings tab. Under Link libraries:, click Add and type

shlwapi

Click OK then OK again.

In the Build menu, click Build workspace. For some reason, after CEGUIBase finished building I had to click Build workspace again in order to build all projects in the workspace; it could be the case you need to do so as well. Build both Debug and Release targets.

Now take a look at C:\MinGW\libs\CEGUI-0.7.9\bin and C:\MinGW\libs\CEGUI-0.7.9\lib - CEGUI's DLLs and import libraries are ready for use.

pcre (for mruby)

Get the CEGUI 0.8.2 Dependencies (Windows / Apple OS X Only) from the CEGUI 0.8.2 page.

Extract cegui-deps-0.8.x-src.zip to C:\MinGW\libs.

Run cmd.exe to open a command prompt and run these commands:

SET PATH=C:\MinGW\bin;%PATH%
C:\CMake\bin\cmake-gui.exe

CMake GUI should be running. Click Browse Source... and browse to C:\MinGW\libs\cegui-deps-0.8.x-src. Do the same with Browse Build.... Click Configure. Choose MinGW Makefiles and Use default native compilers. Click Finish.

Click Configure. After it's done, uncheck all options other than CEGUI_BUILD_PCRE. Then click Configure again, and after it's done click Generate. Close CMake GUI.

Run cmd.exe to open a command prompt and run these commands:

SET PATH=C:\MinGW\bin;%PATH%
cd C:\MinGW\libs\cegui-deps-0.8.x-src
mingw32-make

Now take a look at C:\MinGW\libs\cegui-deps-0.8.x-src\dependencies - the bin/include/lib folders and their contents are ready to use.

Getting the source code and setting it up

Install a git client and add its executable folder to your PATH environment variable.

Create a temporary folder (for example, C:\TEMP), run cmd.exe and checkout the repository:

cd C:\TEMP
git clone git://github.com/Quintus/SMC.git
cd SMC
git checkout mruby
git submodule init
git submodule update

After the checkout is completed, copy the C:\TEMP\SMC\mruby folder to C:\MinGW\libs. Move C:\MinGW\libs\mruby\mgems to C:\MinGW\libs\mruby\mruby. Edit C:\MinGW\libs\mruby\mruby\build_config.rb and paste the following contents:

# Build configuration file for mruby.

# Absolute path to the directory this file resides in,
# independent of any PWD or invocation stuff.
THIS_DIR = File.expand_path(File.dirname(__FILE__))
# Absolute path mruby resides in
MRUBY_DIR = File.join(THIS_DIR, "..", "mruby", "mruby")

config = lambda do |conf, root|
  # Some standard things included with mruby
  conf.gem "#{root}/mrbgems/mruby-sprintf"
  conf.gem "#{root}/mrbgems/mruby-print"
  conf.gem "#{root}/mrbgems/mruby-math"
  conf.gem "#{root}/mrbgems/mruby-time"
  conf.gem "#{root}/mrbgems/mruby-struct"
  conf.gem "#{root}/mrbgems/mruby-enum-ext"
  conf.gem "#{root}/mrbgems/mruby-string-ext"
  conf.gem "#{root}/mrbgems/mruby-numeric-ext"
  conf.gem "#{root}/mrbgems/mruby-array-ext"
  conf.gem "#{root}/mrbgems/mruby-hash-ext"
  conf.gem "#{root}/mrbgems/mruby-range-ext"
  conf.gem "#{root}/mrbgems/mruby-proc-ext"
  conf.gem "#{root}/mrbgems/mruby-symbol-ext"
  conf.gem "#{root}/mrbgems/mruby-random"
  conf.gem "#{root}/mrbgems/mruby-object-ext"
  # conf.gem "#{root}/mrbgems/mruby-eval"

  # Generate mirb command
  conf.gem "#{root}/mrbgems/mruby-bin-mirb"

  # Additional things
  conf.gem "#{THIS_DIR}/../mruby/mgems/mruby-sleep"         # Sleep
  conf.gem "#{THIS_DIR}/../mruby/mgems/mruby-pcre-regexp"   # PCRE Regular Expressions
  conf.gem "#{THIS_DIR}/../mruby/mgems/mruby-md5"           # MD5
  conf.gem "#{THIS_DIR}/../mruby/mgems/mruby-json"          # JSON
end

MRuby::Build.new do |conf|
  toolchain :gcc

  # C compiler settings
  conf.cc do |cc|
    cc.flags = "-Iinclude -Imgems/mruby-md5/include -Isrc -IC:/MinGW/libs/cegui-deps-0.8.x-src/dependencies/include"
  end

  # Linker settings
  conf.linker do |linker|
    linker.flags = "-LC:/MinGW/libs/cegui-deps-0.8.x-src/dependencies/lib/dynamic"
  end

  config.call(conf, root)
end

if ENV["CROSSCOMPILE_TARGET"] and !ENV["CROSSCOMPILE_TARGET"].empty?
  prefix = ENV["CROSSCOMPILE_TARGET"]

  MRuby::CrossBuild.new(prefix) do |conf|
    toolchain :gcc

    conf.cc do |cc|
      cc.command = ENV["CC"] || "#{prefix}-gcc"
    end

    conf.linker do |linker|
      linker.command = ENV["LD"] || "#{prefix}-gcc"
    end

    conf.archiver do |archiver|
      archiver.command = ENV["AR"] || "#{prefix}-ar"
    end

    config.call(conf, root)
  end
end

Run cmd.exe and run the following commands:

SET PATH=C:\MinGW\bin;C:\MinGW\msys\1.0\bin;C:\Ruby193\bin;%PATH%
cd C:\MinGW\libs\mruby\mruby
mingw32-make

Create the following folder tree under C:\ :

+ dev/
| + cpp/
| | + projects/
| | | + SMC/

Copy the contents of the C:\TEMP\SMC\smc folder to C:\Dev\cpp\projects\SMC.

Create empty file smc.rc under C:\Dev\cpp\projects\SMC, open it and paste the following contents:

#include "src/core/global_game.h"
1 ICON DISCARDABLE "extras/icons/idr_main.ico"
1 VERSIONINFO
FILEVERSION    SMC_VERSION_MAJOR,SMC_VERSION_MINOR,SMC_VERSION_PATCH,0
PRODUCTVERSION SMC_VERSION_MAJOR,SMC_VERSION_MINOR,SMC_VERSION_PATCH,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904E4"
        BEGIN
            VALUE "CompanyName"    , "SMC Team"
            VALUE "FileDescription", CAPTION
            VALUE "FileVersion"    , "2.0.0.0"
            VALUE "ProductName"    , CAPTION
            VALUE "ProductVersion" , "2.0.0.0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1252
    END
END

Create empty file SMC.cbp under C:\Dev\cpp\projects\SMC, open it and paste the following contents:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
	<FileVersion major="1" minor="6" />
	<Project>
		<Option title="SMC" />
		<Option pch_mode="2" />
		<Option compiler="gcc" />
		<Build>
			<Target title="Debug">
				<Option output="bin/Debug/SMC" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Debug/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-g" />
					<Add option="-D_DEBUG=1" />
				</Compiler>
				<Linker>
					<Add library="boost_filesystem-mgw48-mt-d-1_54" />
					<Add library="boost_chrono-mgw48-mt-d-1_54" />
					<Add library="boost_system-mgw48-mt-d-1_54" />
					<Add library="boost_thread-mgw48-mt-d-1_54" />
					<Add library="intl" />
					<Add library="..\..\..\..\MinGW\libs\CEGUI-0.7.9\bin\CEGUIBase_d.dll" />
					<Add library="..\..\..\..\MinGW\libs\CEGUI-0.7.9\bin\CEGUINullRenderer_d.dll" />
					<Add library="..\..\..\..\MinGW\libs\CEGUI-0.7.9\bin\CEGUIOpenGLRenderer_d.dll" />
					<Add library="..\..\..\..\MinGW\libs\CEGUI-0.7.9\dependencies\lib\dynamic\libpng_d.a" />
					<Add library="..\..\..\..\MinGW\libs\CEGUI-0.7.9\dependencies\lib\dynamic\libzlib_d.a" />
				</Linker>
			</Target>
			<Target title="Release">
				<Option output="bin/Release/SMC" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Release/" />
				<Option type="0" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-O2" />
					<Add option="-DNDEBUG=1" />
				</Compiler>
				<Linker>
					<Add option="-s" />
					<Add library="boost_filesystem-mgw48-mt-1_54" />
					<Add library="boost_chrono-mgw48-mt-1_54" />
					<Add library="boost_system-mgw48-mt-1_54" />
					<Add library="boost_thread-mgw48-mt-1_54" />
					<Add library="intl" />
					<Add library="..\..\..\..\MinGW\libs\CEGUI-0.7.9\bin\CEGUIBase.dll" />
					<Add library="..\..\..\..\MinGW\libs\CEGUI-0.7.9\bin\CEGUINullRenderer.dll" />
					<Add library="..\..\..\..\MinGW\libs\CEGUI-0.7.9\bin\CEGUIOpenGLRenderer.dll" />
					<Add library="..\..\..\..\MinGW\libs\CEGUI-0.7.9\dependencies\lib\dynamic\libpng.a" />
					<Add library="..\..\..\..\MinGW\libs\CEGUI-0.7.9\dependencies\lib\dynamic\libzlib.a" />
				</Linker>
			</Target>
		</Build>
		<Compiler>
			<Add option="-Wall" />
			<Add directory="../../../../MinGW/libs/boost-1.54.0" />
			<Add directory="../../../../MinGW/libs/CEGUI-0.7.9/cegui/include" />
			<Add directory="../../../../MinGW/libs/CEGUI-0.7.9/dependencies/include" />
			<Add directory="../../../../MinGW/libs/SDL-1.2.15/include/SDL" />
			<Add directory="../../../../MinGW/libs/mruby/mruby/include" />
		</Compiler>
		<Linker>
			<Add library="mingw32" />
			<Add library="SDLmain" />
			<Add library="SDL.dll" />
			<Add library="SDL_mixer" />
			<Add library="SDL_image" />
			<Add library="SDL_ttf" />
			<Add library="user32" />
			<Add library="gdi32" />
			<Add library="winmm" />
			<Add library="dxguid" />
			<Add library="glu32" />
			<Add library="opengl32" />
			<Add library="..\..\..\..\MinGW\libs\mruby\mruby\build\host\lib\libmruby.a" />
			<Add library="..\..\..\..\MinGW\libs\mruby\mruby\build\host\lib\libmruby_core.a" />
			<Add library="..\..\..\..\MinGW\libs\cegui-deps-0.8.x-src\dependencies\lib\dynamic\libpcre.dll.a" />
			<Add directory="../../../../MinGW/libs/boost-1.54.0/lib" />
			<Add directory="../../../../MinGW/libs/SDL-1.2.15/lib" />
		</Linker>
		<Unit filename="smc.rc">
			<Option compilerVar="WINDRES" />
		</Unit>
		<Unit filename="src/audio/audio.cpp" />
		<Unit filename="src/audio/audio.h" />
		<Unit filename="src/audio/random_sound.cpp" />
		<Unit filename="src/audio/random_sound.h" />
		<Unit filename="src/audio/sound_manager.cpp" />
		<Unit filename="src/audio/sound_manager.h" />
		<Unit filename="src/core/camera.cpp" />
		<Unit filename="src/core/camera.h" />
		<Unit filename="src/core/campaign_manager.cpp" />
		<Unit filename="src/core/campaign_manager.h" />
		<Unit filename="src/core/collision.cpp" />
		<Unit filename="src/core/collision.h" />
		<Unit filename="src/core/editor.cpp" />
		<Unit filename="src/core/editor.h" />
		<Unit filename="src/core/file_parser.cpp" />
		<Unit filename="src/core/file_parser.h" />
		<Unit filename="src/core/filesystem/boost_relative.cpp" />
		<Unit filename="src/core/filesystem/boost_relative.h" />
		<Unit filename="src/core/filesystem/filesystem.cpp" />
		<Unit filename="src/core/filesystem/filesystem.h" />
		<Unit filename="src/core/filesystem/resource_manager.cpp" />
		<Unit filename="src/core/filesystem/resource_manager.h" />
		<Unit filename="src/core/framerate.cpp" />
		<Unit filename="src/core/framerate.h" />
		<Unit filename="src/core/game_core.cpp" />
		<Unit filename="src/core/game_core.h" />
		<Unit filename="src/core/global_basic.h" />
		<Unit filename="src/core/global_game.h" />
		<Unit filename="src/core/i18n.cpp" />
		<Unit filename="src/core/i18n.h" />
		<Unit filename="src/core/main.cpp" />
		<Unit filename="src/core/main.h" />
		<Unit filename="src/core/math/line.h" />
		<Unit filename="src/core/math/point.h" />
		<Unit filename="src/core/math/rect.h" />
		<Unit filename="src/core/math/size.h" />
		<Unit filename="src/core/math/utilities.cpp" />
		<Unit filename="src/core/math/utilities.h" />
		<Unit filename="src/core/math/vector.cpp" />
		<Unit filename="src/core/math/vector.h" />
		<Unit filename="src/core/obj_manager.h" />
		<Unit filename="src/core/property_helper.cpp" />
		<Unit filename="src/core/property_helper.h" />
		<Unit filename="src/core/sprite_manager.cpp" />
		<Unit filename="src/core/sprite_manager.h" />
		<Unit filename="src/enemies/bosses/turtle_boss.cpp" />
		<Unit filename="src/enemies/bosses/turtle_boss.h" />
		<Unit filename="src/enemies/eato.cpp" />
		<Unit filename="src/enemies/eato.h" />
		<Unit filename="src/enemies/enemy.cpp" />
		<Unit filename="src/enemies/enemy.h" />
		<Unit filename="src/enemies/flyon.cpp" />
		<Unit filename="src/enemies/flyon.h" />
		<Unit filename="src/enemies/furball.cpp" />
		<Unit filename="src/enemies/furball.h" />
		<Unit filename="src/enemies/gee.cpp" />
		<Unit filename="src/enemies/gee.h" />
		<Unit filename="src/enemies/krush.cpp" />
		<Unit filename="src/enemies/krush.h" />
		<Unit filename="src/enemies/rokko.cpp" />
		<Unit filename="src/enemies/rokko.h" />
		<Unit filename="src/enemies/spika.cpp" />
		<Unit filename="src/enemies/spika.h" />
		<Unit filename="src/enemies/spikeball.cpp" />
		<Unit filename="src/enemies/spikeball.h" />
		<Unit filename="src/enemies/static.cpp" />
		<Unit filename="src/enemies/static.h" />
		<Unit filename="src/enemies/thromp.cpp" />
		<Unit filename="src/enemies/thromp.h" />
		<Unit filename="src/enemies/turtle.cpp" />
		<Unit filename="src/enemies/turtle.h" />
		<Unit filename="src/gui/generic.cpp" />
		<Unit filename="src/gui/generic.h" />
		<Unit filename="src/gui/hud.cpp" />
		<Unit filename="src/gui/hud.h" />
		<Unit filename="src/gui/menu.cpp" />
		<Unit filename="src/gui/menu.h" />
		<Unit filename="src/gui/menu_data.cpp" />
		<Unit filename="src/gui/menu_data.h" />
		<Unit filename="src/gui/spinner.cpp" />
		<Unit filename="src/gui/spinner.h" />
		<Unit filename="src/input/joystick.cpp" />
		<Unit filename="src/input/joystick.h" />
		<Unit filename="src/input/keyboard.cpp" />
		<Unit filename="src/input/keyboard.h" />
		<Unit filename="src/input/mouse.cpp" />
		<Unit filename="src/input/mouse.h" />
		<Unit filename="src/level/level.cpp" />
		<Unit filename="src/level/level.h" />
		<Unit filename="src/level/level_background.cpp" />
		<Unit filename="src/level/level_background.h" />
		<Unit filename="src/level/level_editor.cpp" />
		<Unit filename="src/level/level_editor.h" />
		<Unit filename="src/level/level_manager.cpp" />
		<Unit filename="src/level/level_manager.h" />
		<Unit filename="src/level/level_player.cpp" />
		<Unit filename="src/level/level_player.h" />
		<Unit filename="src/level/level_settings.cpp" />
		<Unit filename="src/level/level_settings.h" />
		<Unit filename="src/objects/animated_sprite.cpp" />
		<Unit filename="src/objects/animated_sprite.h" />
		<Unit filename="src/objects/ball.cpp" />
		<Unit filename="src/objects/ball.h" />
		<Unit filename="src/objects/bonusbox.cpp" />
		<Unit filename="src/objects/bonusbox.h" />
		<Unit filename="src/objects/box.cpp" />
		<Unit filename="src/objects/box.h" />
		<Unit filename="src/objects/enemystopper.cpp" />
		<Unit filename="src/objects/enemystopper.h" />
		<Unit filename="src/objects/goldpiece.cpp" />
		<Unit filename="src/objects/goldpiece.h" />
		<Unit filename="src/objects/level_entry.cpp" />
		<Unit filename="src/objects/level_entry.h" />
		<Unit filename="src/objects/level_exit.cpp" />
		<Unit filename="src/objects/level_exit.h" />
		<Unit filename="src/objects/moving_platform.cpp" />
		<Unit filename="src/objects/moving_platform.h" />
		<Unit filename="src/objects/movingsprite.cpp" />
		<Unit filename="src/objects/movingsprite.h" />
		<Unit filename="src/objects/path.cpp" />
		<Unit filename="src/objects/path.h" />
		<Unit filename="src/objects/powerup.cpp" />
		<Unit filename="src/objects/powerup.h" />
		<Unit filename="src/objects/spinbox.cpp" />
		<Unit filename="src/objects/spinbox.h" />
		<Unit filename="src/objects/sprite.cpp" />
		<Unit filename="src/objects/sprite.h" />
		<Unit filename="src/objects/star.cpp" />
		<Unit filename="src/objects/star.h" />
		<Unit filename="src/objects/text_box.cpp" />
		<Unit filename="src/objects/text_box.h" />
		<Unit filename="src/overworld/overworld.cpp" />
		<Unit filename="src/overworld/overworld.h" />
		<Unit filename="src/overworld/world_editor.cpp" />
		<Unit filename="src/overworld/world_editor.h" />
		<Unit filename="src/overworld/world_layer.cpp" />
		<Unit filename="src/overworld/world_layer.h" />
		<Unit filename="src/overworld/world_manager.cpp" />
		<Unit filename="src/overworld/world_manager.h" />
		<Unit filename="src/overworld/world_player.cpp" />
		<Unit filename="src/overworld/world_player.h" />
		<Unit filename="src/overworld/world_sprite_manager.cpp" />
		<Unit filename="src/overworld/world_sprite_manager.h" />
		<Unit filename="src/overworld/world_waypoint.cpp" />
		<Unit filename="src/overworld/world_waypoint.h" />
		<Unit filename="src/scripting/events/die_event.h" />
		<Unit filename="src/scripting/events/downgrade_event.cpp" />
		<Unit filename="src/scripting/events/downgrade_event.h" />
		<Unit filename="src/scripting/events/event.cpp" />
		<Unit filename="src/scripting/events/event.h" />
		<Unit filename="src/scripting/events/gold_100_event.h" />
		<Unit filename="src/scripting/events/jump_event.h" />
		<Unit filename="src/scripting/events/key_down_event.cpp" />
		<Unit filename="src/scripting/events/key_down_event.h" />
		<Unit filename="src/scripting/events/level_load_event.cpp" />
		<Unit filename="src/scripting/events/level_load_event.h" />
		<Unit filename="src/scripting/events/level_save_event.cpp" />
		<Unit filename="src/scripting/events/level_save_event.h" />
		<Unit filename="src/scripting/events/shoot_event.cpp" />
		<Unit filename="src/scripting/events/shoot_event.h" />
		<Unit filename="src/scripting/events/touch_event.cpp" />
		<Unit filename="src/scripting/events/touch_event.h" />
		<Unit filename="src/scripting/objects/boxes/mrb_bonusbox.cpp" />
		<Unit filename="src/scripting/objects/boxes/mrb_bonusbox.h" />
		<Unit filename="src/scripting/objects/boxes/mrb_box.cpp" />
		<Unit filename="src/scripting/objects/boxes/mrb_box.h" />
		<Unit filename="src/scripting/objects/boxes/mrb_spinbox.cpp" />
		<Unit filename="src/scripting/objects/boxes/mrb_spinbox.h" />
		<Unit filename="src/scripting/objects/boxes/mrb_textbox.cpp" />
		<Unit filename="src/scripting/objects/boxes/mrb_textbox.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_eato.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_eato.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_enemy.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_enemy.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_flyon.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_flyon.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_furball.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_furball.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_gee.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_gee.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_krush.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_krush.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_rokko.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_rokko.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_spika.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_spika.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_spikeball.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_spikeball.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_static.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_static.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_thromp.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_thromp.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_turtle.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_turtle.h" />
		<Unit filename="src/scripting/objects/enemies/mrb_turtle_boss.cpp" />
		<Unit filename="src/scripting/objects/enemies/mrb_turtle_boss.h" />
		<Unit filename="src/scripting/objects/misc/mrb_audio.cpp" />
		<Unit filename="src/scripting/objects/misc/mrb_audio.h" />
		<Unit filename="src/scripting/objects/misc/mrb_input.cpp" />
		<Unit filename="src/scripting/objects/misc/mrb_input.h" />
		<Unit filename="src/scripting/objects/misc/mrb_level.cpp" />
		<Unit filename="src/scripting/objects/misc/mrb_level.h" />
		<Unit filename="src/scripting/objects/misc/mrb_level_player.cpp" />
		<Unit filename="src/scripting/objects/misc/mrb_level_player.h" />
		<Unit filename="src/scripting/objects/misc/mrb_timer.cpp" />
		<Unit filename="src/scripting/objects/misc/mrb_timer.h" />
		<Unit filename="src/scripting/objects/mrb_eventable.cpp" />
		<Unit filename="src/scripting/objects/mrb_eventable.h" />
		<Unit filename="src/scripting/objects/mrb_smc.cpp" />
		<Unit filename="src/scripting/objects/mrb_smc.h" />
		<Unit filename="src/scripting/objects/mrb_uids.cpp" />
		<Unit filename="src/scripting/objects/mrb_uids.h" />
		<Unit filename="src/scripting/objects/powerups/mrb_fireplant.cpp" />
		<Unit filename="src/scripting/objects/powerups/mrb_fireplant.h" />
		<Unit filename="src/scripting/objects/powerups/mrb_moon.cpp" />
		<Unit filename="src/scripting/objects/powerups/mrb_moon.h" />
		<Unit filename="src/scripting/objects/powerups/mrb_mushroom.cpp" />
		<Unit filename="src/scripting/objects/powerups/mrb_mushroom.h" />
		<Unit filename="src/scripting/objects/powerups/mrb_powerup.cpp" />
		<Unit filename="src/scripting/objects/powerups/mrb_powerup.h" />
		<Unit filename="src/scripting/objects/powerups/mrb_star.cpp" />
		<Unit filename="src/scripting/objects/powerups/mrb_star.h" />
		<Unit filename="src/scripting/objects/specials/mrb_level_exit.cpp" />
		<Unit filename="src/scripting/objects/specials/mrb_level_exit.h" />
		<Unit filename="src/scripting/objects/specials/mrb_path.cpp" />
		<Unit filename="src/scripting/objects/specials/mrb_path.h" />
		<Unit filename="src/scripting/objects/sprites/mrb_animated_sprite.cpp" />
		<Unit filename="src/scripting/objects/sprites/mrb_animated_sprite.h" />
		<Unit filename="src/scripting/objects/sprites/mrb_moving_sprite.cpp" />
		<Unit filename="src/scripting/objects/sprites/mrb_moving_sprite.h" />
		<Unit filename="src/scripting/objects/sprites/mrb_particle_emitter.cpp" />
		<Unit filename="src/scripting/objects/sprites/mrb_particle_emitter.h" />
		<Unit filename="src/scripting/objects/sprites/mrb_sprite.cpp" />
		<Unit filename="src/scripting/objects/sprites/mrb_sprite.h" />
		<Unit filename="src/scripting/scriptable_object.cpp" />
		<Unit filename="src/scripting/scriptable_object.h" />
		<Unit filename="src/scripting/scripting.cpp" />
		<Unit filename="src/scripting/scripting.h" />
		<Unit filename="src/user/preferences.cpp" />
		<Unit filename="src/user/preferences.h" />
		<Unit filename="src/user/savegame.cpp" />
		<Unit filename="src/user/savegame.h" />
		<Unit filename="src/video/animation.cpp" />
		<Unit filename="src/video/animation.h" />
		<Unit filename="src/video/color.h" />
		<Unit filename="src/video/font.cpp" />
		<Unit filename="src/video/font.h" />
		<Unit filename="src/video/gl_surface.cpp" />
		<Unit filename="src/video/gl_surface.h" />
		<Unit filename="src/video/img_manager.cpp" />
		<Unit filename="src/video/img_manager.h" />
		<Unit filename="src/video/img_settings.cpp" />
		<Unit filename="src/video/img_settings.h" />
		<Unit filename="src/video/renderer.cpp" />
		<Unit filename="src/video/renderer.h" />
		<Unit filename="src/video/video.cpp" />
		<Unit filename="src/video/video.h" />
		<Extensions>
			<DoxyBlocks>
				<comment_style block="0" line="0" />
				<doxyfile_project />
				<doxyfile_build />
				<doxyfile_warnings />
				<doxyfile_output />
				<doxyfile_dot />
				<general />
			</DoxyBlocks>
			<code_completion />
			<envvars />
			<debugger />
		</Extensions>
	</Project>
</CodeBlocks_project_file>

Compiling

You'll have to patch a few files.

src/core/global_game.h

--- global_game.h.orig	2013-10-08 22:59:47 +0000
+++ global_game.h	2013-10-12 18:16:59 +0000
@@ -15,11 +15,15 @@
 
 #ifndef SMC_GLOBAL_GAME_H
 #define SMC_GLOBAL_GAME_H
-#include "config.h"
 
 namespace SMC
 {
 
+// For non-Windows platforms
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#endif
+
 /* Turns the version numbers into a numeric value:
  * (1,2,3) -> (10203)
  * Assumes that there will never be more than 100 minor or patch versions
@@ -30,7 +34,10 @@
 
 // Caption
 #define CAPTION "Secret Maryo Chronicles"
-
+// Version
+#define SMC_VERSION_MAJOR 2
+#define SMC_VERSION_MINOR 0
+#define SMC_VERSION_PATCH 0
 static const unsigned int smc_version = SMC_VERSION_NUM(SMC_VERSION_MAJOR, SMC_VERSION_MINOR, SMC_VERSION_PATCH);
 
 /* *** *** *** *** *** *** *** Object Direction *** *** *** *** *** *** *** *** *** *** */

src/audio/audio.cpp

--- audio.cpp.orig	2013-10-08 22:59:47 +0000
+++ audio.cpp	2013-10-12 18:19:13 +0000
@@ -551,7 +551,7 @@
 		}
 
 		// load the given music
-		m_music = Mix_LoadMUS( filename.c_str() );
+		m_music = Mix_LoadMUS( filename.string().c_str() );
 
 		// loaded
 		if( m_music )
@@ -597,7 +597,7 @@
 		}
 
 		// load the wanted next playing music
-		m_music = Mix_LoadMUS( filename.c_str() );
+		m_music = Mix_LoadMUS( filename.string().c_str() );
 	}
 
 	return true;

src/scripting/objects/sprites/mrb_particle_emitter.cpp

--- mrb_particle_emitter.cpp.orig	2013-10-08 22:59:47 +0000
+++ mrb_particle_emitter.cpp	2013-10-12 18:21:00 +0000
@@ -193,7 +193,7 @@
 static mrb_value Get_Image_Filename(mrb_state* p_state,  mrb_value self)
 {
 	cParticle_Emitter* p_emitter = Get_Data_Ptr<cParticle_Emitter>(p_state, self);
-	return mrb_str_new_cstr(p_state, p_emitter->m_image_filename.c_str());
+	return mrb_str_new_cstr(p_state, p_emitter->m_image_filename.string().c_str());
 }
 
 /**

Open SMC.cbp in Code::Blocks, then click Build. If all went well in the previous steps, wait a few minutes and you should have a shiny new SMC.exe file in C:\Dev\cpp\projects\SMC\bin\Debug.

In order to run it you'll need the following DLLs, which can be found in the appropriate subfolders under C:\MinGW\libs: CEGUIBase_d.dll, CEGUIExpatParser_d.dll, CEGUIFalagardWRBase_d.dll, CEGUIFreeImageImageCodec_d.dll, CEGUINullRenderer_d.dll, CEGUIOpenGLRenderer_d.dll, FreeImaged.dll, libboost_chrono-mgw48-mt-d-1_54.dll, libboost_filesystem-mgw48-mt-d-1_54.dll, libboost_system-mgw48-mt-d-1_54.dll, libboost_thread-mgw48-mt-d-1_54.dll, libFLAC-8.dll, libfreetype-6.dll, libjpeg-8.dll, libmikmod-2.dll, libogg-0.dll, libpcre.dll, libpng15-15.dll, libtiff-5.dll, libvorbis-0.dll, libvorbisfile-3.dll, libwebp-2.dll, SDL.dll, SDL_image.dll, SDL_mixer.dll, SDL_net.dll, SDL_ttf.dll, smpeg.dll, zlib1.dll.

Do the same for Release and copy the appopriate DLLs.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox