Everything above is good advice IMHO.

I cannot see all your code but I suspect...
At line 13 of main.cpp you create a new Game object.
During constructing the Game object you more than likely try to create a Bar object (in drawBars()).
Constructing the Bar object relies on the global Game object pointer which has not been initialised yet (because you are still evaluating the RHS of line 13).


You need to rethink how objects get a pointer to the Game object, and whether it is needed at all. Why does the Bars object need to know about the Game object? Is there a better way to achieve the same thing?