Compiler Recognize Classes

Im using CodeBlocks on windows vista, I have an error which reads:
error 'Person' does not name a type.
This is found in my weapon class.


[code]
#ifndef WEAPON_H_INCLUDED
#define WEAPON_H_INCLUDED
#include "Person.h"

class Weapon
{
public:
Weapon();

Person person; // This and the line below it produce an error
// int attack(Person person);

std::string _name;

private:
int _condition;
int _damage;

};


#endif // WEAPON_H_INCLUDED
[/code]

However I am able to use Person class in other files which I have defined myself. Furthermore, the person class and other classes which I defined myself can use the weapons class. It is just for some reason, the weapons class refuses to include the other classes I have defined. I believe it must be a linking error but I have tried everything. Does anyone know why code blocks will not allow my weapons class to recognize my other classes?
If needed I can provide the Person.h - Person.cpp File


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories