hey,
I have a cyclic include thing going on, it should be fine because i am forward declaring..
whats goin on here
// perception.h
#pragma once
#include "agent.h"
// forward Declaration
class Agent;
class Perception
{
public:
Agent* pClosestKin;
Agent* pClosestMate;
Agent* pClosestFood;
Agent* pCloasestThreat;
Perception(void);
~Perception(void);
};
//agent.h
#pragma once
//other includes clipped//
#include "perception.h"
#define MUTATION 15
// forward declaration
class Perception;
class Agent : public WereIRenderable, public WereIFileable
{
protected:
static std::map<std::string, Agent*> m_AgentMap;
public:
static long* pAgentID;
std::string m_location;
WereModel * m_pModel;
Behavior* m_pBehavior;
Stats* m_pStats;
AgentState m_state;
Perception m_perception;
// rest of class clipped//
have i forward declared wrong?
both of the classes compile if i dont try to mix them
here is the error
Agent.h(36): error C2079: 'Agent::m_perception' uses undefined class 'Perception'
thanks