I am trying to inherit CObject but am failing to do so. My class looks like this:
class CCanMessage : public CObject
{
public:
CCanMessage(void);
~CCanMessage(void);
unsigned int m_id; //can-id
CANMessageTypes m_msgType; //this is an enum
unsigned char m_len;
char *m_pCmdStr;
};
The constructor and destructor are empty.
When I compile I get error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject'
. I have been looking for an explanation for some time now without finding one. I assume the error is embarrassingly simple, but I just can't seem to find it.
Worth noting is that if I don't use the CCanMessage class anywhere the compilation error disappears. The error points to the declaration of the class and not to any place I use the class.