Hi,
I have a class named 'roomOne' and another named 'StoneAdventure'. 'roomOne' inherits from 'StoneAdventure'.
Heres the Problem: Whenever I create an #include "roomOne.h" in the header file of 'StoneAdventure' I get an error C2504: base class is undefined.
Note: Everything works fine if I remove the #include "roomOne.h" from the StoneAdventure.h. I need to create the roomOne Object in the StoneAdventure.h so it can be accessed by the functions.
Am I going on this the wrong way??
#ifndef StoneAdventure_H
#define StoneAdventure_H
#include "Controls.h"
#include "RoomOne.h"
#include <iostream>
using namespace std;
namespace ROOMS{
enum emun
{
ROOM1,
ROOM2,
};
}
using namespace ROOMS;
class StoneAdventure: public Controls
{
public:
StoneAdventure();
~StoneAdventure();
void render();
private:
};
#endif
#ifndef RoomOne_H
#define RoomOne_H
#include "StoneAdventure.h"
#endif // !RoomOne_H
class RoomOne: public StoneAdventure
{
public:
RoomOne();
~RoomOne();
void render();
private:
void ifGo();
void ifLook();
void ifInventory();
void ifOpen();
void ifClose();
void ifAttack();
void ifTake();
void ifPut();
void ifDrop();
};