declaration

i included the header file and its still giving error. here is the code

1
2
3
4
5
6
#include "Enemy.h"
class Player
{
    public:
        void attack(Enemy,int);
}


any ideas why this is? here is the error

H:\Workspace\game2\Player.h|13|error: 'Enemy' has not been declared|
If I had to guess, because Enemy.h doesn't declare Enemy, or it does it in a namespace that you forgot to specify you were using
1
2
3
4
5
6
7
#include "Enemy.h"
using namespace std;
class Player
{
    public:
        void attack(Enemy,int);
}


it still gives the same error
Is Enemy part of the std namespace? I would be surprised.

Does Enemy.h definitely define the class Enemy?
You forgot to place a semicolon after your class definition.:)
If still you have problems,
Provide the Enemy.h or Enemy class. that might help us helping you.
Topic archived. No new replies allowed.