Is forward declaration for a class from another project is possible? If so,
how to do?

There are 2 Projects A and B,

I want to forward declare a class of Project B in A, when doing so it says
the class is undefined?

Am i missing out any steps?

Regards,
Alamelu N

Re: Forward Declaration by Alex

Alex
Tue Apr 15 06:48:15 CDT 2008

"Alamelu" wrote:
> Is forward declaration for a class from another project is
> possible? If so, how to do?
>
> There are 2 Projects A and B,
>
> I want to forward declare a class of Project B in A, when doing
> so it says the class is undefined?
>
> Am i missing out any steps?

If all that you need is to declare a pointer to a class from
project B, then forward declaration is sufficient. However, if you
need to call class' methods, then you must include class' header
file with full definition.


HTH
Alex



Re: Forward Declaration by Alamelu

Alamelu
Tue Apr 15 07:42:00 CDT 2008

Thanks.

"Alex Blekhman" wrote:

> "Alamelu" wrote:
> > Is forward declaration for a class from another project is
> > possible? If so, how to do?
> >
> > There are 2 Projects A and B,
> >
> > I want to forward declare a class of Project B in A, when doing
> > so it says the class is undefined?
> >
> > Am i missing out any steps?
>
> If all that you need is to declare a pointer to a class from
> project B, then forward declaration is sufficient. However, if you
> need to call class' methods, then you must include class' header
> file with full definition.
>
>
> HTH
> Alex
>
>
>