The Project
Goblin Camp is a long dead open source game that had the aim of being a Dwarf-Fortress clone. As of 2010 or so the project was declared dead with a few interested and maybe naive would be contributors looking to revive the project, At least that’s how I would describe myself. A little over a month about a few class mates of mine began a new GitHub Repository for Goblin Camp with the sole purpose of reviving and contributing to the long forgotten project. Through much effort they have been able to get the out dated to code to run utilizing TravicCI to build they were able to get it to build for a Linux machine. With the only available executable of the game being built for Windows this was a huge accomplishment. However not being Linux user myself I wanted to build the project from source the way the original developers did.
Boost Jam
The Goblin Camp project was originally built use the Boost.Jam tool which is normally just referred to as boost. This tool is an updated fork of the Jam building tool used to replace the Makefiles with Jamfiles for installing/configuring projects. This is particularly useful for Windows as there is no good alternative for the make command other then using Cmake. I’ve never used boost before and struggled with cmake in the past so I was interested in seeing if boost could fix my struggle of getting cpp projects compiled. Lucky all the .jam files are already create in the original project so following the given build instructions it should be straight forward enough to compile since its just outdated code.
Dependencies
As with any sizable cpp project there bound to be external libraries you need to link to the project for it to build. With requiring many different libraries it’s in our best interests to create a folder to hold all our .lib and source files for linking into the project once we get there. The folder we’ll use is for our .lib files will be C:\Dev\libs and the source files will go to C:\Dev\libs\include. Luckily on Windows we do not require to link to OpenGL as it is already include on all windows machine. So the only dependencies we’ll need for to build the are SDL 1.2, SDL_Image 1.2, libpng, zlib, python 2.7, WinSDK v7.1, the gcc compiler, and of course BJam.
Upon downloading an external library you first want to know where it’s source files are located which is normally in its own include folder or in the root directory. If we have gotten a precompiled library we would also be able to find the .lib files in a Lib folder. Sadly however often these library come uncompiled requiring us to do more drudge work. Each of the required libraries may need some help to compile successfully so lets tackle them one at a time using visual studios.
Compiling Simple DirectMedia Layer (SDL 1.2)
Upon downloading SDL 1.2 we will get a folder containing something like:

What we’re most interested in is where is the visual studio solution located which can normally be found in some VisualC\.. directory. Once we find the .sln directory we open it with the version of visual studio we have installed and it will re target the solution so it can open with our version. To compile the library we first want to switch to release & x64 mode and then run build. If the build was successful we can now find the SDL.lib & SDLmain.lib in their project’s x64\release folders. We now want to copy the file to C:\Dev\libs and the files in the include directory into C:Dev\libs\include.
Compiling SDL_Image 1.2
Just like SDL we’ll have to compile this library. We can find the visual studio solution in sdl_image-1.2.12\VisualC so go ahead and open that now. However this library requires SDL.h to build, luckily we just compiled that library so we can link it following a few simple steps (remember to switch to Release & x64 before you build). Open the solution and right click on the project in the solution explorer and open the properties page. We are looking to first add the additional libraries to the project within the C/C++ tab.

We now have to link these libraries. Without linking the external libraries the linker which creates the our single executable will not be able to add the external libraries and we’ll get an error along the lines of “unresolved external symbols”. Navigating to the Linker-All Options we include the .lib and its path to the additional dependencies/library directories. Be sure to do this for all projects in the solution individually as they do not share properties.

Following these steps will have you run into an error “cannot open file ..\Release\SDL_image.lib” this error occurs because the SDL_image project place it’s .lib file in the wrong location we can either change the path to ..\x64\Release\SDL_image.lib or move the .lib file to the desired path. Once the two project have compiled we can their .lib files to C:\Dev\libs and the source files found in SDL_image-1.2.12’s root directory to C:\Dev\libs\include.
Compiling zlib
Just like the SDL libraries zlib requires us to compile it. We can find the solution in zlib-1.2.11\contrib\vstudio\vc{version}, zlib offers a bunch of versions of the visual studio solution I’m using visual studio 2017 which uses vc14. Building the project for Release & x64 should succeed without issue. We then can move the x64\ZlibDllRelease\zlibwapi.lib & x64\ZlibStatRelease\zlibstat.lib files into our C:\dev\libs folder and of course the source files found in zlib-1.2.11\ into our include directory.
Compiling libpng
Compiling this library proves to be a little more difficult then the previous ones. A detailed article getting this library to compile can be found here
Python27
By default python27 will come full compiled and can be found in c:\python. We’re going to want to create a copy of the folder and move it to C:\Dev\apps\
WinSDK v7.1
following the link above and running the installer provided will install the require files. If you are running on Windows 10 you will first need to uninstall microsoft visual studio 2010 redistributed x64/x86 using the control panel.

After doing so the download should be successful and our library can be found at C:\Program Files\Microsoft SDKs\Windows\v7.1. We can then copy the Include and Lib folder into C:\Dev\libs\WinSDK\v7.1.
All the dependencies are now install and in the desired location you C:\Dev\libs and C:\Dev\libs\Include folders should look something like.


Bjam
Bjam is an executable so upon downloading in order to use it we will have to add it’s location as an environment variable in our system, this process is outlined here. Once we have completed this we should open the command prompt to check if it’s being found correctly.

Of course we will still get an error as we have not told bjam to build anything yet.
Installing the GCC compiler
We will install the gcc compile via mingw which provides a simple download for any windows machine. The install directory will be C:\Program Files (x86)\mingw-w64. The gcc executable will be within the bin folder. After downloading we will have to add the gcc compiler to our environment variables list for our system. Upon adding to the path we can test that gcc is available for use by opening a command prompt and typing gvv <enter>

Building the project
Will all the dependencies install we can finally get started on building the executable for our project. Download the project and place it in any folder you want. We then want to navigate to that folder in the command prompt.
From here we will build the project. However first we require to setup of config file, because we have statically create our libraries we have to ensure that the project’s .jam files can find them. Create a file called gc-config.jam which contains the text:
using gcc ;
using libpng : <library>C:/Dev/libs <include>C:/Dev/libs/include/libpng <name>lpng14 ;
using sdl : <library>C:/Dev/libs <include>C:/Dev/libs/include ;
using winsdk : <library>C:/Dev/libs/WinSDK/v7.1/Lib <include>vC:/Dev/libs/WinSDK/v7.1/Include ;
using zlib : <library>C:/Dev/libs <include>C:/Dev/libs/include/zlib <name>zdll ;
using python : <library>C:/Dev/apps/Python27/libs <include>C:/Dev/apps/Python27/include <exec>C:/Dev/apps/Python27/python.exe <name>python27 ;
If you skipped the steps of moving the libraries to the C:\Dev folder you may need to edit this file’s paths.
Finally we can build the project as described by the developers the command should look something like the following.
bjam --user-config=gc-config.jam toolset=gcc variant=debug -jN=2
And with plenty of
…patience…
we get
…Failed updating targets…
Some compilation errors are to be expected and the small victory of having no unresolved external errors is progress. The build is failing with a few different errors so lets see if we can create some workarounds to get it to build just once.
fixing error: ‘::hypot’ has not been declared using ::hypot;
This is the most common error on the first build. The reason for this error as describe by HavelTheGreat is that our pyconfig header file is renaming our ::hypot variable to ::_hypot. There are two potential work arounds for this error.
- Include <cmath> before python compiles
- Re-declare ::hypot to ::_hypot in the cmath file
Number 2 is the simplest as it does not require us to edit build files. Within the cmath file edit the line 1121 to look like:
#define hypot _hypot
using ::_hypot;
it’s a crude a fix but when we attempt to rebuild we will no longer see this error.
The Rest
As of now there are 11 failing targets which seem to all have the same error simply boot there not there. files with various extensions like .gch, .o ect… are not found within the file tree and so cannot be build. As of now I have not found a way to track down why these files are there or aren’t being created.
The End for now
For now I’ll have to take a break from attempt to compile this project myself. It feels like success is close but being unfamiliar with the boost.build files I a lot more research to do before i figure out what the problems are.