Error 1 error C2079: 'Main::m_Graphics' uses undefined class 'Graphics'
Error 2 error C2079: 'Main::m_Events' uses undefined class 'Events'
8 IntelliSense: incomplete type is not allowed
9 IntelliSense: incomplete type is not allowed
Your Main class wants to hold Graphics and Events objects. That means your compiler has to know the size of those objects, which means knowing the definition beforehand. But only the prototypes are provided, so the compiler cannot determine the size of this undefined classes.
Forward declaration of classes only works for pointers and references, because they don't need to know the size of an object. That's why for your Main class, you need to include the proper headers and why for your other two classes, forward declaration works.
However, if you are having two or more classes that have each other as member objects (whether or not through pointers), I would be suspect of the design. Why do Events and Graphics need pointers to Main?
I still am very much a beginner, so I am still learning the best programming practices. Therefore, I am not sure my design is good, but I would like to try it just to see how it goes. I am still reading a lot and just started getting into the intermediate stuff and this is the most elegant I have managed to make it. Before this, the functions that handle events and graphics and the control of the program were all outside of classes and in the same file. I am improving little by little!
They need pointers because I was thinking main would hold a vectors of Objects (menus, windows and other things), so Graphics needs to access main to get those objects in order to draw them, while Events needs a pointer to main to get to Graphics or Objects in order to respond to input, for example. This program is intended to be the framework of my future programs, by the way.
Also, there is something that may be preventing me from achieving the best design: I am very much of an OCD person when it comes to programming. For example, maybe giving those vectors of objects to Graphics would make the design better, but it really annoys me when a class has something that in my mind doesn't belong there. Luckily, I program exclusively as a hobby, so that wouldn't get in the way of my career or anything.