why is my base class undefined

I'm not sure why it says my base class is undefined when it's clearly there. Before making changes, it was working but i reverted back to this original code and for some reason it's not working. I think I just might be missing piece of vital code.

my compiler says that my 'character' base class is undefined in creature.h

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//creature.h
#pragma once
#ifndef creature_h
#define creature_h
#include "character.h"



class creature: public character {
public:
	creature(const std::string& name, size_t health, size_t strength);

	size_t health();
	size_t strength();

	void health(size_t health);
	void strength(size_t strength);

	friend std::ostream& operator<<(std::ostream& os, const creature& c);

};
#endif // !creature_h 


and here's character.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#ifndef character_h
#define character_h
#include "gameObject.h"
#include "weapons.h"




class character : public gameObject {
public:
	character(const std::string& name,
		size_t health = 100, size_t strength = 10, size_t defense = 40);
	virtual ~character() {}

	void attackwith(const weapons* w);


	size_t health()const;
	size_t strength()const;

	void health(size_t health);
	void strength(size_t strength);

	friend std::ostream& operator<<(std::ostream& os, const character& chars);


protected:

	size_t health_, strength_;
};


#endif // character_h 


create a new directory called "foo" and copy-paste creature.h and character.h there.
then go to that directory (make sure that you are in that directory and no somewhere else) and compile creature.h

post the error message that throws you then.
Topic archived. No new replies allowed.