• 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: Martin Taylor <email@hidden>
  • Date: Wed, 28 Jun 2006 09:07:42 +0100

I assume from the fact that you are forward declaring MySprite that MyElement.h does not include MySprite.h?
I that case, the problem is simply that the class declaration of MySprite is not visible in MyElement.h.
If it worked on your PC, perhaps you were using pre-compiled headers on your PC project?


Martin

On 28 Jun 2006, at 06:56, Abin Thomas wrote:

Hai,

I am porting one application from PC to mac using xcode 2.2 with gcc4.

This construct works fine in PC.




---------------------------------------------------------------------- --------------------------------
First File : MYSprite.h
---------------------------------------------------------------------- --------------------------------


class MYSprite : public Myfoo
{
}


---------------------------------------------------------------------- --------------------------------
Second File : MYElement.h
---------------------------------------------------------------------- --------------------------------


class MYSprite;    // error : forward declaration of 'struct MYSprite'

class MYElement{

protected :

             MYSprite*      mpSprite;
public :

           inline foo() {  mpSprite->GetAvg();  }  // error: invalid
use of undefined type 'structMYSprite'

};




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 ??

Please comment!
Thanks,

Aby
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40artwork-systems.com


This email sent to email@hidden

_______________________________________________ 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: Re: error : forward declaration of 'struct MYSprite'
  • Next by Date: breakpoints don't work
  • Previous by thread: Re: error : forward declaration of 'struct MYSprite'
  • Next by thread: Re: error : forward declaration of 'struct MYSprite'
  • Index(es):
    • Date
    • Thread