Hi sorry for yet another circular inclusion problem but I need help understanding why I cant add a new class CSprite to my project that inherits CShape. I get an error C2504 base class is undefined. I've tried so many permutations of including files. Also can anyone suggest a neater/efficient/correct way of how my includes should be set up. (include-graph)
Here are the header files with the functions snipped:
Main.h -->
#ifndef main_h
#define main_h
// Windows and DirectX includes
#define STRICT
#include "windows.h"
#include <d3d9.h>
#include <d3dx9.h>
//#include <vector>
#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "d3dx9.lib")
// Application centered includes
#include "D3DDefs.h"
#include "CApplication.h"
using namespace std;
// GLOBALS
class CApplication;
extern CApplication g_App; // Controls all the DirectX objects and devices
#endif // main_h *********************************************************
CApplication.h -->
#ifndef CApplication_h
#define CApplication_h
#include "Main.h"
#include "CSpriteManager.h"
#include "CShape.h"
#include "CSprite.h"
#include "CLight.h"
class CSpriteManager;
class CShape;
class CSprite;
class CLight;
class CApplication
{
public:
CApplication(void);
~CApplication(void);
};// CApplication
#endif // CApplication.h *************************************************
CSpriteManager.h -->
#ifndef CSpriteManager_h
#define CSpriteManager_h
#include "Main.h"
#include "CShape.h"
#include "CSprite.h"
class CShape;
class CSprite;
class CSpriteManager
{
public:
CSpriteManager(void);
~CSpriteManager(void);
int Clone(CShape* pSource, CShape* pDest);
int Clone(CSprite* pSource, CSprite* pDest);
};// CSpriteManager
#endif // CSpriteManager_h
CShape.h -->
#ifndef CShape_h
#define CShape_h
#include "Main.h"
class CShape
{
public:
CShape(void);
~CShape(void);
}; // CShape
#endif // CShape_h
CSprite.h -->
#ifndef CSprite_h
#define CSprite_h
#include "CShape.h"
//class CShape;
class CSprite: public CShape
{
public:
CSprite(void);
~CSprite(void);
};// CSprite
#endif // CSprite_h
All the other classes compile fine its just when I added this class as inherited from CShape.
I look forward to your thoughts :)