Does enemy.h need map.h or the other way around? You should make up your mind. Otherwise someone will include "enemy.h", which will include "map.h", which will try to include "enemy.h", but this will not do anything because you are using include guards, then the compiler will get to the point where Enemy is used, but it hasn't been defined yet (since we haven't seen the majority of "enemy.h").
You could make Enemy::update take a constant reference to a map, instead of a map by value, and then instead of including "map.h" you can get away with a "forward declaration" (look it up).
"global.h" also smells funny... although it probably isn't responsible for this particular problem.
Does enemy.h need map.h or the other way around? You should make up your mind. Otherwise someone will include "enemy.h", which will include "map.h", which will try to include "enemy.h", but this will not do anything because you are using include guards, then the compiler will get to the point where Enemy is used, but it hasn't been defined yet (since we haven't seen the majority of "enemy.h").
You could make Enemy::update take a constant reference to a map, instead of a map by value, and then instead of including "map.h" you can get away with a "forward declaration" (look it up).
"global.h" also smells funny... although it probably isn't responsible for this particular problem.
No. Capital E.
"It's like naming him Asskicker Monstertrucktits O'Ninja" -Khaiy
Mrchrismnh, the name of the header and the name of the class within the header are unrelated...
The problem is a circular include (map includes enemy and enemy includes map).
If your CPP file includes map first, this happens:#ifndef MAP_H_INCLUDED // test passes, we enter the #if
#define MAP_H_INCLUDED
#include "enemy.h"
//---
#ifndef ENEMY_H_INCLUDED // test passes, we enter the #if
#define ENEMY_H_INCLUDED
#include "map.h"
//---
#ifndef MAP_H_INCLUDED // test fails, we don't enter the #if
#endif
//--
class Enemy{
void update(Map lv);//Error - map hasn't been declared yet
If your CPP file includes enemy first, this happens:#ifndef ENEMY_H_INCLUDED // test passes, we enter the #if
#define ENEMY_H_INCLUDED
#include "map.h"
//---
#ifndef MAP_H_INCLUDED// test passes, we enter the #if
#define MAP_H_INCLUDED
#include "enemy.h"
//---
#ifndef ENEMY_H_INCLUDED // test fails, we don't enter the #if
Oh shiiiiiii I got rated down even more now I'll never get hired on to one of those MMO teams and those pay big money once the final project is completed and you get a share of the subscriptions!
"It's like naming him Asskicker Monstertrucktits O'Ninja" -Khaiy