it doesnt recognize my header files... why?????

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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "MAP.h"
#include "PLAYER.h"
#include <cstdlib>
#include <ctime>
#include <iostream>
using namespace std;

int main()
{
	srand( time(0) );
	Map gameMap;
	Player mainPlayer;
	mainPlayer.createClass();
	//begin adventure.
	bool done = false;
	while (!done)
	{
		gameMap.printPlayerPos();
		int selection = 1;
		cout <<"1) Move, 2)Rest, 3) View Stats, 4) Quit: ";
		cin >> selection;
		Monster* monster= 0;
		switch(selection)
		{
		case 1:
			//Move the player.
			gameMap.movePlayer();
			//check for a random encounter. this function returns a null pointer if no monsters are encountered.
			monster = gameMap.checkRandomEncounter();
			//monster not null, run combat simulation.
			if ( monster != 0)
			{
				while (true)
				{
					mainPlayer.displayHitPoints();
					monster->displayHitPoints();
					cout << endl;
					bool runAway = mainPlayer.attack(*monster);

					if (runAway)
						break;
					if(monster->isDead() )
					{
						mainPlayer.victory(monster->getXPReward());
						mainPlayer.levelUp();
						break;
					}
					monster -> attack(mainPlayer);
					if (mainPlayer.isDead())
					{
						mainPlayer.gameover();
						done = true;
						break;
					}
				}
				/* the pointer to a monster returned from
				check random encounter was allocated with "new"
				so we must delete it to avoid memory leaks*/
				
				delete monster;
				monster = 0;
			}
			break;
		case 2:
			mainPlayer.rest();
			break;
		case 3:
			mainPlayer.viewStats();
			break;
		case 4:
			done = true;
			break;
		}//end switch statement
	}//end while statement
}//end main function. 



it just doesnt recognize my headers even if i got them opened in an another tab in the same project...
the error reported is. fatal error C1083: Cannot open include file: 'Map.h': No such file or directory!!
closed account (zb0S216C)
If you've set an include directory (specifying the location of your headers) within your project (assuming this is a project), then you need to replace the quotation marks with angle brackets.

Wazzak
i didnt:/
Is Map.h in the right directory? It should be in the same directory as whatever cpp file this is.
i figured this out thx for the help!
Topic archived. No new replies allowed.