Public Group

#### Archived

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

# 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.

## 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 on other sites
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 on other sites
Nevermind

[edited by - AdolphousC on April 1, 2003 11:39:28 PM]

##### 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.

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 10
• 9
• 9
• 11
• 11
• ### Forum Statistics

• Total Topics
633690
• Total Posts
3013340
×

## Important Information

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!