Mail Archives: djgpp/1997/12/31/06:30:24
oferco (oferco AT cs DOT huji DOT ac DOT il) writes:
> Hye,
>
> Anyone who can, PLEASE answer this:
>
> My compiler complains:
> foo.cc: in method x:
> foo.cc: 3523: cannot lookup method in incomplete type 'Memory'
>
> where Memory is a class I use in the Method x, which is
> a member of the class A - defined in foo.cc and declared
> in foo.hh
> BUT
> all the other methods of A, which use Memory, are not reffered
> to by this kind of error - only x !!!
>
> WHATS WRONG???
All the other uses probably pass pointers to the class around. It looks
like you've got a forward declaration like
class Memory;
followed by this class, and later by the Memory class.
You should instead either change method X in the class to just
inline int x (Foo bar, Memory lapse);
And write a method body after the body of class Memory:
inline int x (Foo bar, Memory lapse) {
lapse.happen();
bar.baz();
return 42;
}
--
.*. Friendship, companionship, love, and having fun are the reasons for
-() < life. All else; sex, money, fame, etc.; are just to get/express these.
`*' Send any and all mail with attachments to the hotmail address please.
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca pgd73 AT hotmail DOT com
- Raw text -