Re: error : forward declaration of 'struct MYSprite'
Re: error : forward declaration of 'struct MYSprite'
- Subject: Re: error : forward declaration of 'struct MYSprite'
- From: Thomas Engelmeier <email@hidden>
- Date: Wed, 28 Jun 2006 12:30:15 +0200
On Jun 28, 2006, at 7:56 AM, Abin Thomas wrote:
I am porting one application from PC to mac using xcode 2.2 with gcc4.
This construct works fine in PC.
I bet it is not working at all - class MYSprite lacks the ; at the end..
----------------------------------------------------------------------
--------------------------------
First File : MYSprite.h
----------------------------------------------------------------------
--------------------------------
class MYSprite : public Myfoo
{
}
[....]
1) error: invalid use of undefined type 'struct MYSprite'
2) error: forward declaration of 'struct MYSprite'
I am getting the above two errors for all the lines which use the
mpSprite in the second file.
Did anybody encountered such situation before ??
I did not because usually in my code the DEFINITION of an class -
what the compiler needs to work, i.e. contents of your header - is
visible (aka #included) when it is required.
The diagnostic message from the compiler is:
"You tell me I need to access something from MYSprite but instead of
telling me (defining) what MySprite is you simply DECLARED that
something called MySprite exists. Here is where you did it.."
HTH,
Tom_E
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden