Trying to set up a good development toolchain can always be a little daunting. Thankfully setting up SDL2 and C++ development is relatively easy, even though some operating systems still make things way harder than they should be.

I’ve written about how one of my main reasons for choosing SDL2 was it’s excellent cross-platform support. So I realized that, before I could continue coding some moving elements, I first had to create a setup that would allow me to build this project quickly for multiple systems.

The big three

So naturally I picked the big three operating systems (Windows, Linux and macOS) as my target platforms to try this on. My first test was already running on Linux, so I decided to tackle macOS next, since its Unix underpinnings make it relatively similar to Linux.

This turned out to be the case, as getting the same code up and running on macOS requires more or less the same steps as in the Ubuntu installation I had done my first test in. And before long, the same code was compiling and running on the Mac.

X marks the cross-platform happiness…

Windows

Then along came Windows and mucked up all my plans. The less rigid structure of this system means lots more time (and curse words) had to be spent tweaking settings and environment variables, just to make sure everything pointed at the right libraries.

So after a lot more time was spent than I’d like, the code was running on Windows as well. I wish this step had been a little more painless.

I can’t describe how glad I was to finally get this working as well.

The good thing is, that the whole Windows experience made me rethink my strategy for building a bit. Instead of trying to juggle different hand-written Makefiles for different systems, I’ve concluded that it’s much smarter to use something like CMake and have that do a lot of the dirty work.

So the next step will be to get CMake doing its brave thing on all three platforms and then I’ll finally be ready to jump into some basic movement stuff.

DON’T MISS A BLOGPOST

Be the first to know when a new Caged Wave blogpost appears!