When ever I try to program programs with a few classes and headers in different files sometimes it gives me
error: some_class does not name a type
for example I have the following classes in different files:
Canimatedtile
Clayer
Cmap
and map is declared some what like this (Please excuse some of the syntax errors in my real files there are no syntax errors)
Code:
#include "layer.h"
class Cmap
{
public:
Clayer layer[6]; //6 tile layers
}
and layer is declared like this
Code:
#include "animatedtile.h"
class Clayer
{
public:
int tiles[256][256]; //256*256 tile map
Canimatedtiles animatedtiles[20];
}
It will give me this error in map.h:
Code:
error: Clayer does not name a type
It happens with other things that I try to program that also have multiple classes; I get simular results with those. I am using an IDE. I know very little about makefiles, but my guess is that the makefile the IDE is generating is in the wrong order.
What I am basically asking is what should I do to avoid and fix these types of errors?
Thank you for suggestions and help.