Original Post
I''ve read many posts with a lot of good information on OOP, but I''m having troubles with my own program, here is a basic outline of what my how my program is written:
///////////////////////////////////////
//CGame.h
///////////////////////////////////////
#ifndef __CGAME_H_INCLUDED__
#define __CGAME_H_INCLUDED__
include "Client.h"
class Client;
class CGame
{
public:
Client player;
//Other crap
}
#endif
///////////////////////////////////////
//Client.h
///////////////////////////////////////
#ifndef __CLIENT_H_INCLUDED__
#define __CLIENT_H_INCLUDED__
include "CGame.h"
class CGame;
class Client
{
public:
CGame world;
//Other crap
}
#endif
///////////////////////////////////////
//main.cpp
///////////////////////////////////////
#include "CGame.h"
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
{
CGame game;
//Uses CGame functions
return 0;
}
But I get the following error:
CGame.h(55) : error C2079: ''player'' uses undefined class ''Client''
I have tried many ways around this but with no luck!
What have I done wrong?