Where is the variable "game" at line 13 of Bars.cpp defined and initialized? It is not a member variable and has not been passed in to the constructor but it is used extensively. If unused unintialized, or its member scene etc. has not been initialized, then segfaults will be your friend.