I have a derived class from an abstract base class that creates an object of another class privately inside of it. I have included the header files with the class definitions in it, but the private class object's class datatype isn't working when I compile. Here's what it looks like:
scenes.h:
#ifndef _SCENES_H_
#define _SCENES_H_
#include "common.h"
#include "scene.h"
#include "CMap.h"
//Game
class CGame: public CScene
{
private:
CMap *Map; //<---------------Problem here (look below at error)
public:
CGame();
~CGame();
void render(){}
UInt8 loop(){return 0;}
};
#endif
CMap.h:
#ifndef _CMAP_H_
#define _CMAP_H_
#include "common.h"
class CMap
{
private:
sMapHeader Header;
sMapParam Param;
vector<SDL_Surface> vTextures;
vector<string> vstrTextures;
sMapBase *pMap;
SInt16 *pMapDecor;
SDL_Surface *MapSurface;
bool loadMap(string filename);
void loadTextures();
public:
CMap(string filename){ if(!loadMap(filename)){ loadTextures(); } }
};
#endif
And I get this error when I compile:
c:\Users\xxxx\Documents\Visual Studio Projects\Neon\scenes.h(24) : error C2143: syntax error : missing ';' before '*'
c:\Users\xxxx\Documents\Visual Studio Projects\Neon\scenes.h(24) : error C2501: 'CGame::CMap' : missing storage-class or type specifiers
c:\Users\xxxx\Documents\Visual Studio Projects\Neon\scenes.h(24) : error C2501: 'CGame::Map' : missing storage-class or type specifiers
I can't figure out for the life of me why it can't simply see the CMap class. I've even started a new project over from scratch, added the source files again, and compiled, but I get the same errors. Thanks in advance!
Edit: I'm using MSVC++ 2003 .NET