I have two classes Object and Chassis and I include each class with the opposite ones header. This is causing a redefinition error. I understand why, but I don't know how to fix it. Here is the Code:
#ifndef GAME_h
#define GAME_h
#include "Object.h"
class Game{
void AddObject(Object o);
SDL_Renderer *GetRenderer(){ /*returns renderer*/ }
/*random code*/
}
#endif
#ifndef OBJECT_h
#define OBJECT_h
#include "Game.h"
class Object{
void CreateObject(/*settings*/);
void SetTexture(Game g, const char* loc); //Uses Game to Load Texture
/*random code*/
}
#endif
Thanks in advance!