When I execute this code, I get the following error: ‘Block’ does not name a type
This is the code:
Block.h
#include "Area.h"
#ifndef Block_H
#define Block_H
#ifndef Cube_H
#include "Cube.h"
#endif
#ifndef nullptr
#define nullptr 0
#endif
class Block : public Area
{
int ID;
int BlockType;
Cube *cube;
Block()
{
ID=0;
BlockType=0;
cube=0;
}
};
#endif
Cube.h
#include "Area.h"
#ifndef Cube_H
#define Cube_H
#ifndef Block_H
#include "Block.h"
#define Block_H
#endif
// put all your classes and other stuff here
class Cube : public Area
{
Block *blocks[8]=nullptr;
int ID;
};
#endif // end of MYHEADER_H
this code, for whatever reason, doesn't compile. I've cross checked it with other sources, and it still doesn't compile.
Thanks.