I realize this question has been asked many times and the solution is usually forward declarations. However, if I am correct, forward declarations can't be used when member functions are being used in that file. I have a circular dependency that I'm not sure how to fix through design and each dependency uses member functions. Here is my code:
// GUI.h
#include "ElementButton.h"
class GUI
{
public:
vector<ElementButton*> Buttons;
void ParseElements(); // Uses ElementButton member functions
};
// Element.h
#include "GUI.h"
class Element
{
public:
void ReplaceGUI(string GUITextFile); // Uses GUI member functions and destructors
GUI* CurrentGUI;
};
// ElementButton.h
#include "Element.h"
class ElementButton : public Element
{
public:
void OnButtonClicked(); // Uses inherited ReplaceGUI function
};