declaration
| usama8800 (3) |
|
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|
|
|
|
| Moschops (5981) |
|
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
|
|
|
| usama8800 (3) |
|
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
|
|
|
| Moschops (5981) |
|
Is Enemy part of the std namespace? I would be surprised.
Does Enemy.h definitely define the class Enemy?
|
|
|
| cpathrd (6) |
|
If still you have problems,
Provide the Enemy.h or Enemy class. that might help us helping you.
|
|
|
Topic archived. No new replies allowed.