invalid use of incomplete type (co-dependant classes and forward declaration)
Hi All,
I just signed up after i found a partial answer here to a problem i'm facing.
-I have a class (class A) which has a reference to an event handling class (class B).
-class B then can't include class A.h because it would be mutually dependant (A includes B already), so i use forward declaration.
-all is well until i try to use a reference in class B to class A with classA->method().
then i get a compile error invalid use of incomplete type ClassA.
it's seems that before i actually use a forward declared pointer the compiler must see the complete definition. But how to make this happen? Is forward declaration really a solution to the problem of mutually dependant classes?
can anyone help?
(happy to post actual code if necessary)
Liam
|