I keep this error and i don't know why, right now I have base class Runner which has one virtual function which is overriden in a derived class ghost my code is below
Runner.h
#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_*/
Ghost.h
#ifndef GHOST_H_
#define GHOST_H_
#include <QtGui>
#include "Runner.h"
class Ghost: public Runner{
public:
Ghost(QColor c);
~Ghost();
int tryMove();
void move();
void redraw(QPainter * painter);
protected:
private:
int direction;
};
#endif /*GHOST_H_*/
when i compile this I get this error:
Ghost.h:7: error: expected class-name before ‘{’ token
I really can't see why this happening