undeclared Identifier

I checked spelling, and to no avail, I still can't fix this problem:
In my Eq.h file I have:
class Eq
{
public:
typedef enum ROLE_TYPE{ NO_ROLE=0,RT_P,RT_D,RT_O,MAX_ROLE_TYPE};
protected:
const enum ROLE_TYPE RoleType;
public:
void SetScanItems(const enum ROLE_TYPE _RoleType);
};
in my cpp file I have:
#include "Eq.h"
void SetScanItems(const enum ROLE_TYPE _RoleType)
{
RoleType = _RoleType;
}
and on the RoleType = _RoleType; I get 'RoleType':undeclared identifier
Can anyone please help me find out what's wrong?
Thanks :)
Change in your cpp file to this:
1
2
3
4
5
#include "Eq.h"
void Eq::SetScanItems(const enum ROLE_TYPE _RoleType)
{
  RoleType = _RoleType;
}
I did your suggested change, and I got a different error on the same line. Now the error is:
errorC2166: l-value specifies const object
FIXED!! I removed "const" from the .h instantiation :) thank you !!!
Topic archived. No new replies allowed.