0

As of now I have the below:

#ifndef RUNNER_H_
#define RUNNER_H_

#include "Maze.h"
#include <QtGui>

class Runner{
public:
	Runner(QColor c);
	int runnerSize;
	void setLocation(int,int);
	void setMaze(Maze);
	virtual void redraw(QPainter * painter) = 0;
	virtual ~Runner();

protected:
	int rXcoor;
	int rycoor;
	Maze * rMazePanel;
	QColor rColor;
private:


};

#endif /*RUNNER_H_*/
#ifndef MAZE_H_
#define MAZE_H_

#include "Player.h"
#include "Ghost.h"
#include <QtGui>

class Maze: public QWidget{
public:
	Maze(Player*,Ghost[],QWidget * parent = 0);
	int mWidth;
	int mHeight;
	int mWallDistance;
    int mBrickGap;
	int collideWall(int,int);

protected:
	 void paintEvent(QPaintEvent *event);
private:
	int mBrick[25][25];
	QColor mBackgroundColor;
	QColor mWallColor;
	Player * mPlayer;
	Ghost * mGhost;
};

#endif /* MAZE_H_ */

however when I compile this it doesn't recognize Maze as a type of class and I have no idea why
I would appreciate any kind of help

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by Albinoswordfish
0

What sort of error message(s) do you get?

Did you check the spelling?

Did you check that your include guards are correct? If you re-use them in another file (say copy/paste without a complete edit), then you lose.

Are there any other maze.h files lying around, say in another directory?
Try

#ifndef MAZE_H_
#define MAZE_H_
#error Yep, included it OK

If you get to the #error, it will fail to compile.
But it will at least prove you're including that file.

0

Well I fixed the error, the problem was that there was a maze.o file in the same directory and I guess it was causing the compiler confusion

0

oh wait sorry about that, now I know why i fixed the error

it was because I was including files in my header that I didn't really need. Apparently a header should only be included if a forward declaration is required. So by getting rid "maze.h" in my runner.h file solved this problem

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.