• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: error : forward declaration of 'struct MYSprite'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >error : forward declaration of 'struct MYSprite' (From: "Abin Thomas" <email@hidden>)

  • Prev by Date: breakpoints don't work
  • Next by Date: Re: Objective-C++ Exceptions (was: PICT control problems)
  • Previous by thread: Re: error : forward declaration of 'struct MYSprite'
  • Next by thread: breakpoints don't work
  • Index(es):
    • Date
    • Thread