You need to initialize the GameObject
member in the containing class' initializer list.
// In the GameWorld.h header..
class GameWorld
{
public:
GameWorld(); // Declare your default constructor.
protected:
GameObject gameobject; // No () here.
}
// In the GameWorld.cpp implementation file.
GameWorld::GameWorld() // No 'void' return type here.
: gameObject(ctorParams) // Initializer list. Constructing gameObject with args
{
}