The purpose of this mini-guide is to document a successful build of SuperTux following the information given on the wiki-page Building on Windows. I have done this because I am a non-expert at building from source and thus my experience may be of help to others. The whole process took me three hours with troubleshooting, recording, and occasional mild distractions. If everything went off without a hitch, I would expect about half that time. Hopefully this effort might help someone build faster.
The system built on is Windows 7 Ultimate (64-bit) which has never had SuperTux on it, making it a relatively clean system. I built SuperTux version 0.3.4 from the GIT repository. I found that the final product could be played on another Windows 7 machine without much effort.
I will try to be both as explicit and concise as possible. Any deviation or alteration to the process described in Building on Windows will be noted (some notes have already been incorporated into the main page). I will attempt to include as much information possible that could be useful.
Make a folder to contain everything, in this example I used C:\Users\\supertux_build
This serves to not only keep everything together, but also acts as a Linux-like Home from which the source is built from.
Obtain the SuperTux source code
Download all the dependencies to supertux_build from the links indicated
Install and configure dependencies
run MinGW installer
change install location: C:\Users\\supertux_build
I choose to install all components, took < 10 min to install [!] In order to be able to actually use MSYS I had to copy/merge all contents from supertux_build/msys/1.0/msys to supertux_build
open 7-zip, navigate to supertux_build then select and extract the downloads for:
while still in 7-zip navigate to SDL*.tar and extract to supertux_build
while still in 7-zip navigate to physfs*.tar and extract to supertux_build
exit 7-zip
move physfs-2.0.2 from supertux_build/physfs-2.0.2 to supertux_build
move boost_1_47_0 from supertux_build/boost_1_47_0 to supertux_build
make a new folder “local” C:\Users\\supertux_build\local
copy/merge the following folders from your extracted dependencies into C:\Users\\supertux_build\local
copy ogg.dll, vorbis.dll & vorbisfile.dll from C:\Program Files (x86)\OpenAL*\samples\playoggvorbis\Win32 to C:\Users\\supertux_build\local\bin
copy OpenAL32.dll and wrap_oal.dll from C:\Windows\SysWOW64 to C:\Users\\supertux_build\local\bin
Build physfs
in the command line type:
cd /physfs*
mkdir build; cd build
cmake .. -G “MSYS Makefiles” -DCMAKE_INSTALL_PREFIX:PATH=/local
make [!] I got errors here, specifically “error: variable 'lastDirectory' set but not used [-Werror=unused-but-set-variable]” and “all warnings being treated as errors” this didn't seem like something that should prevent the build so I commented out the lines containing “lastDirectory” in C:\Users\\supertux_build\physfs-2.0.2\archivers\wad.c running make after this resulted in success
make install
Build Supertux [!] The build process failed for me with a bunch of errors relating to “rusty_trampoline”, since I've never seen a level that uses it I just eliminated it from SuperTux. I am uncertain if the problem is due to SuperTux actually being reliant on a more recent version of a dependency or if it is a Windows only issue. Anyway to remove it from SuperTux do the following: 1) comment or remove two lines in C:\Users\\supertux_build\supertux\src\supertux\object_factory.cpp (search “rusty” to find them) 2) remove 2 files in C:\Users\\supertux_build\supertux\src\objects\rusty*
Back in the msys command prompt (msys.bat) type
cd /supertux
mkdir build; cd build
INCLUDE=“/local/include/SDL:/boost_1_47_0” cmake -G“MSYS Makefiles” -DCOMPILE_AMALGATION=ON -DCMAKE_CXX_FLAGS=-Wl,--enable-auto-import ..
make
some final file copying to get it all to work on windows, from msys command prompt:
cd ..
cp /local/bin/*.dll .
cp /local/lib/*.dll .
cp /mingw/bin/*.dll .
I was not sure exactly how to “use objdump -p or strings to prune the tree”, it may not even matter for most users, but I manually removed libraries to see what broke the building process leaving these dll files in supertux_build/supertux
play: type /supertux/supertux2 in msys command prompt or open the application directly from its executable
After this process I had a nice updated version of SuperTux running in Windows. However, it should be very apparent that the process is very long and prone to hiccups. While these steps worked for me, it is quite possible that others will run into their own random issues, especially if using other versions of any of the software including OS. Novices may have an exceptionally difficult time troubleshooting issues and finding workarounds such as those I found in building physfs and supertux itself. Perhaps one is better off heeding the advice in Building on Windows#Warnings and finding something more productive to do.
The final product (somewhat modified for packaging purposes) can be downloaded here.