I watched recent You Tube video: C++ Development with Visual Studio Code with Julia Reid.
In the video, Julia shows how to use Visual Studio Code to build and even debug SuperTux2 video game:
It was interesting how to build this nice game with Visual Studio Code. I have used it for demo samples as I have used Visual Studio Community Edition to build more complex projects.
I followed the Video and I was surprised what easy was to build and generate such game:
This is my own build:
However, it was not that clear in Julia´s video how to sort out all the issues faced when trying to build SuperTux from scratch.
So, before being successful to get SuperTux running as in screenshot I had to troubleshoot.
This post details what I did to get same results that Julia.
What is assumed is that you already installed Visual Studio Code:
Visual Studio Build Tools:
cmake Visual Studio Extension:
Then you clone SuperTux repository and open the project with Visual Studio Code.
At this part the video skips a lot of explanation.
Julia explains how to set the active key to Visual Studio Tools 2019 – amd64
She also explains how to setup build variant to Cmake: Debug Ready
At this point the build config is done but if you try to follow this sequence you will see this kind of error:
This error means that all third party libraries used by SuperTux are not installed in your system. In Julia’s case, she already installed those dependencies with vcpkg. So at this point is important to mention that we need to install vcpkg!
Clone vcpkg repo from:
Go to git folder and run:
to build vcpkg.exe.
vcpkg integrate install
Note the message displayed:
At this point, setup cmake configuration to point cmake to vcpkg. Open cmake extension settings and setup settings.json. Notice that path is the same that the one displayed by vcpkg integrate install.
Then, to enable tab completion:
vcpkg integrate powershell
Then install manually with vcpkg the dependencies. These are mentioned in video and also posted in INSTALL.md file:
“sdl2”, “sdl2-image”, “openal-soft”, “curl”, “libogg”, “libvorbis”, “freetype”, “glew”, “boost-date-time”, “boost-filesystem”, “boost-format”, “boost-locale”, “boost-system”, “physfs”
vcpkg install --triplet windows-64 sdl2
vcpkg will install by default 32 bits packages. By using the –triplet parameter you will install 64 bits version of packages instead of 32 bits.
Every time you install a package, click on the build gear button to generate cmake build file. You will get new error mentioning missing library/package. Once you generate successfully the build the tool will try to build SuperTux. Then you will get error that .lib files are missing
Those libs are provided by same project. Build them manually one by one. Select the target:
Then build every single target. lib files will be built.
Finally select SuperTux2 target. This will build exe file.
In my case, when trying to run or debug nothing happened. I launched manually exe file generated in build folder an error message showed that 2 dlls were not found:
squirrel.lib and sqstdlib.lib
Copy 2 dlls into build folder.
Finally, I wanted to try vcpkg.json manifest file support. I only found that feature included in latest roadmap: