Recently, I attempted to show someone the progress of my JelloStorm game on their computer. Of course, they are using a Linux machine (Ubuntu 17.04) and I downloaded the game source code from my GitLab. The pre-requisite is to have SFML installed, which I did, and then I attempted to build the game. Unfortunately, it didn’t work.

cmath

The particular error was that of atan2 being out of scope or not properly declared. It took me a while to figure out, but it came down to the need to include cmath in my build files. For some reason, on my desktop computer, cmath is just included by default when I build. I don’t have to declare it.

On their machine, however, cmath is not included by default, and I don’t know why. Actually, I’m not sure why it is included by default on my machine, nor why it is not included on their machine. However, adding a simple line fixed the issue:

#include <cmath>

The scary part, though, is how much is “auto included” on my machine that will give others problems if they attempt to build it?

Linux – keep it simple.

Leave a Reply

Your email address will not be published. Required fields are marked *