⚠️ The latest commit is currently broken since Bob is working on wrapping everything inshared_ptr, if you want a buildable commit, please change the project to the last working commit by runninggit reset --hard bd12292e037de0babb79b4106125df95d4d5436fin the project root directory.
This guide is for compiling straight from the bob's game repo. All of the modified files are in this repo.
Join the discussion Discord!
Bob claimed Visual Studio 2022 works with compiling bob's game, you may want to try that if you cannot find the download for Visual Studio 2017 Community.
- Download Visual Studio 2017 from https://visualstudio.microsoft.com/vs/older-downloads/ (You may need a Microsoft account)
- Download "Visual Studio Community 2017 (version 15.9)."
- In the Visual Studio Installer make sure to install these:
Workloads:
- Desktop development with C++
Individual components:
- VC++ 2017 version 15.9 v14.16 latest v141 tools
- Windows 10 SDK (10.0.15063.0) for Desktop C++ (x86 and x64)
- Create a folder called
workspaceinC:\Users\Administrator. - Clone bob's game using
git clone https://github.com/bobsgamed/ok.gitand rename it tobobsgame. - Launch Visual Studio 2017 and login to your Microsoft account.
- Open the project with File > Open > Project/Solution.
- Open
bobsgame.slninC:\Users\Administrator\workspace\bobsgame. - Set the release type from Debug to Release.
- Download boost from https://boostorg.jfrog.io/artifactory/main/release/1.64.0/source/boost_1_64_0.zip.
- Extract the
boost_1_64_0folder toC:\Users\Administrator\workspace. - Head to Project > Properties > C/C++ > General > Additional Include Directories.
- Replace
F:\boost_1_64_0with..\boost_1_64_0. It should look like this:
.;.\lib;.\lib\glew-2.0.0\include;.\lib\SDL2-devel-2.0.5-VC\SDL2-2.0.5\include;.\lib\SDL2_ttf-devel-2.0.14-VC\SDL2_ttf-2.0.14\include;.\lib\SDL2_mixer-devel-2.0.1-VC\SDL2_mixer-2.0.1\include;.\lib\SDL2_image-devel-2.0.1-VC\SDL2_image-2.0.1\include;.\lib\SDL2_net-devel-2.0.1-VC\SDL2_net-2.0.1\include;.\lib\SDL2_gfx-1.0.3;.\lib\soloud_20160109\include;.\lib\hyperic-sigar-1.6.4\sigar-bin\include;.\lib\poco-1.7.8p3-all\Foundation\include;.\lib\poco-1.7.8p3-all\JSON\include;.\lib\poco-1.7.8p3-all\Net\include;.\lib\poco-1.7.8p3-all\Util\include;.\lib\poco-1.7.8p3-all\XML\include;.\lib\poco-1.7.8p3-all\Zip\include;.\lib\enet-1.3.13\include;.\lib\zlib-1.2.8\include;.\lib\libzip-1.1.3\lib;.\lib\libzip-1.1.3\src;.\lib\zlib-1.2.8\contrib\minizip;.\lib\minilzo-2.09;.\lib\miniz-master;.\lib\cereal-master\include;..\boost_1_64_0;..\boost_1_64_0\stage\lib;.\lib\GWEN-master\gwen\include;%(AdditionalIncludeDirectories)
- Click Apply then go to Linker.
- Go to Additional Library Directories and Replace
F:\boost_1_64_0\stage\libwith..\boost_1_64_0\stage\lib. It should look like this:
.\lib\glew-2.0.0\lib;.\lib\SDL2-devel-2.0.5-VC\SDL2-2.0.5\lib\x86;.\lib\SDL2_ttf-devel-2.0.14-VC\SDL2_ttf-2.0.14\lib\x86;.\lib\SDL2_mixer-devel-2.0.1-VC\SDL2_mixer-2.0.1\lib\x86;.\lib\SDL2_image-devel-2.0.1-VC\SDL2_image-2.0.1\lib\x86;.\lib\SDL2_net-devel-2.0.1-VC\SDL2_net-2.0.1\lib\x86;.\lib\soloud_20160109\lib;.\lib\hyperic-sigar-1.6.4\sigar-bin\lib;.\lib\poco-1.7.8p3-all\_lib;.\lib\zlib-1.2.8\lib;.\lib\libzip-1.1.3\Release;..\boost_1_64_0\stage\lib;.\lib\GWEN-master\gwen\lib\windows\vs2010;%(AdditionalLibraryDirectories)
- Click Apply then OK.
- You need to compile GWEN and boost, follow the instructions below to compile them.
- Right click bobsgame in the Solution Explorer and click Build.
- Copy the
_copy.batin this repo to thebobsgamefolder. It will make abob's gamefolder on your desktop with all the files required.
Skip over this section if you copied from this repository, but follow steps 4, 6, 7, 11 and 12.
- Head over to
C:\Users\Administrator\workspace\bobsgame\lib\GWEN-master\gwen\Projectsand open a terminal there. - Edit the
Build.batfile and removeremon the line where it saysrem premake4 vs2010. - A Visual Studio 2010 project should be created in
C:\Users\Administrator\workspace\bobsgame\lib\GWEN-master\gwen\Projects\windows\vs2010. - Open the solution in Visual Studio 2017, it will ask you to retarget projects, make sure your Windows SDK version is
10.0.19041.0and the Platform Toolset isUpgrade to v141. Click OK. - Edit
C:\Users\Administrator\workspace\bobsgame\lib\GWEN-master\gwen\src\Platforms\gwen_platform_base.cppand add#include <chrono>. - Right click the
GWEN-Staticproject and click "Properties". - Go to General (or Advanced) > Character Set and select "Not Set". Apply and click OK.
TODO: Some way to do this without modifying file names and source.
- Rename
src/Bootil/Base.cpptosrc/Bootil/BBase.cppandsrc/Bootil/Threads/Utility.cpptosrc/Bootil/Threads/TUtility.cpp. - Rename all references to these functions to these:
IsKeyDown -> LIsKeyDown
IsLeftMouseDown -> LIsLeftMouseDown
IsRightMouseDown -> LIsRightMouseDown
OnMouseMoved -> LOnMouseMoved
OnMouseClicked -> LOnMouseClicked
OnKeyEvent -> LOnKeyEvent
OnCanvasThink -> LOnCanvasThink
- Create a
version.txtfile and add a version number, it could be something like3389. However, this is not required to run the game. - Go to the release type and change it from Debug to Release.
- Right click the GWEN-Static project and click Build.
- The build should succeed and you should have a
gwen_static.libfile inC:\Users\User\Administrator\workspace\bobsgame\lib\GWEN-master\gwen\lib\windows\vs2010.
Skip this step if you copied from this repository, but build it still.
- Delete your
GWEN.slnfile inC:\Users\User\Administrator\workspace\bobsgame\lib\GWEN-master\gwen\lib\windows\vs2010and replace it with the one in thegwenfolder with this guide. - Copy the files
Renderer-OpenGL_TruetypeFont.vcxproj,Renderer-OpenGL_TruetypeFont.vcxproj.filters, andRenderer-OpenGL_TruetypeFont.vcxproj.userfrom thegwenfolder with this guide toC:\Users\User\Administrator\workspace\bobsgame\lib\GWEN-master\gwen\lib\windows\vs2010. - Reload Visual Studio and build Renderer-OPENGL_TruetypeFont.
- Head to
C:\Users\User\Administrator\workspace\boost_1_64_0. - Open a terminal and run
.\bootstrap.bat. - Run
.\b2 runtime-link=staticuntil bootstrapping finishes. This may take a while, like it says, ...patience...