I have a small- to medium-size project that I am doing for my software engineering course this semester. I have chosen to do it in C++ (gtkmm). I am doing okay so far but I
When I try and do this I get the error presented at the very top of this post. If I try and remove the class MainWindow; and replace it with #include "MainWindow.h" I run into circular reference issues with headers.
But this is the issue. You need to move the implementation into a separate implementation (.cpp) file. You can use forward declarations to break circular references in header files, but you have to have both headers available before you attempt to use your type.
You have to include the full definition of you class before you can use it -- not just a forward declaration. Forward declarations are only useful to other forward declarations -- the compiler needs to know what type it's working with before it can generate code.