I am using Visual C++ 2010 express edition and i am making classes but when i run i get the error:
1>c:\documents and settings\louisa\my documents\visual studio 2010\projects\ninja wars\ninja wars\game.cpp(71): error C2065: 'm_pScreen' : undeclared identifier

In my Game.cpp i have this code
void Game::Draw()
	Sprite::Draw(m_pScreen, testSprite, 0, 0);
	Sprite::Draw(m_pScreen, testSprite, 300, 300, 0, 0, 50, 50);


And i have been told to add:
When testing the function in Game::Draw() add SDL_Flip(m_pScreen);

In my game.h i have
						void Init(const char* title, int width, int height, 
                                  int bpp, bool fullscreen);

						  bool Running() {return m_bRunning;}

                          void HandleEvents(Game* game);
                          void Update();
			 void Draw();

                          void Clean();

can anyone see where i can add it where it fixes the error.

8 Years
Discussion Span
Last Post by griswolf

The error message is clear: 'm_pScreen' : undeclared identifier tells you that you have tried to use an identifier m_pScreen and that identifier is not declared in the scope that is in effect at line 71. Judging from the horrible Hungarian notation name, it should be a member of the Game class which is a pointer to a Screen. Presumably you didn't declare this member in the Game class declaration (and so, probably, you also didn't initialize it in the constructor).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.