Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

AdolphousC

SDL Class Errors

This topic is 5734 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am having problems with one particular function, the function of the class is below, along with the included files for this particular cpp file, and the 4 related errors, that because I am just learning the code, I dont really know that well... If you need to see the other clases, let me know and I''ll post them, but I dont want to take up huge amounts of space with code if I dont need it. #include"Sprite.h" #include"SpriteBase.h" #include int Sprite :: InitSprite( SpriteBase *base, SDL_Surface *screen ) { SpriteBase = base; if ( SpriteBase->built ) { if ( SpriteBase->numFrames > 1 ) Animate = true; // This starts the hero facing forward, if you run into // Another room or want them facing a different direction // Change the Element in Anim[0] to whatever you want BackReplacement = SDL_DisplayFormat( SpriteBase->Anim[0].AnimImage ); } screen = screen; return 0; } That is the function that the breakpoint in my Microsoft C++ compiler is pointing to, mainly the first line, it doesn''t seem to like the arguments I am passing to that particular function... here are the errors more specficially. error C2065: ''base'' : undeclared identifier error C2597: illegal reference to data member ''Sprite::SpriteBase'' in a static member function error C2275: ''SDL_Surface'' : illegal use of this type as an expression error C2448: '''' : function-style initializer appears to be a function definition I hope that it is something as silly as a semi colon or spelling error, but I can see it, so any help would be appriciated.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
uhh i can''t see your .h files, but i''m assuming the problem is

SpriteBase = base;

you don''t seem to quite understand the difference between variable types and variables...

Share this post


Link to post
Share on other sites
Thanks for the help, although you could be a little less harsh, but I figured out my errors, so you did indeed help. I appriciate it.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!