I have a class which contains references to other classes by storing their pointers as variables. This all works great with the exception of one class. One of them needs to also know about the container class so that it can access other contained objects so I tried creating a member variable for this and passing it the this pointer when the container class constructed it. I do have a work around for this but this is how I would prefer to do it if possible.
The specific error is as follows:
"Expected ')' before '*' for both the constructor and the member variable declaration in the header file. No error in the source file. I checked the syntax with other classes and data types and they don't complain which leads me to think that the compiler is complaining about the circular reference. Am I correct in thinking this?
This one's tricky, I'd have to play around with it myself to know for sure, but here is a suggestion based on postings in another thread:
You might be able to add forward declarations for the classes that are used at the top of the header files and only include the other header files in the source files.
Seymore I owe you one. That just saved me having to redo a lot of the structure of my program. It worked beautifully (although I don't directly use makefiles, my IDE's handle that bit for me).