Hiya, got a bit of a problem with some of my classes. Each class has its own files (such as MyClass.cpp and MyClass.h), and all is going swimmingly.

My code is designed such that there is a class, AppClass, which contains all instances of the other classes - AgentClass and ItemClass. Inside my AgentClass, i need a function to which i can pass my instance of AppClass, as each AgentClass object will need to search for nearby Agents or Items. Below is exactly which files include which other files.


(ObjectClass is the base class on which all objects inside the game (be it items or agents) are built upon.)


Main.cpp:
Code:
#include "ObjectClass.h"
#include "AgentClass.h"
#include "ItemClass.h"
#include "AppClass.h"

AppClass.h:
Code:
#include "ObjectClass.h"
#include "AgentClass.h"
#include "ItemClass.h"
AgentClass.h:
Code:
#include "ObjectClass.h"
ItemClass.h:
Code:
#include "ObjectClass.h"
Now, inside my AgentClass i have tried including AppClass.h in order to let me use an AppClass instance as a parameter for a function. The problem is, including AppClass throws up a stupid amount of errors, none of which even hint at how to remedy the problem.

Any ideas? even ideas of what to google would be appreciated - i have tried already but its quite a hard problem to phrase in such a way that google understands.

Cheers for your time.