If I have a class.....
class cdcHolder
{
public:
cdcHolder();
virtual ~cdcHolder();
static CDC* cdcPointer;
};
And implementation.....
cdcHolder::cdcHolder() {}
cdcHolder::~cdcHolder() {}
Why, when I do the following in a seperate file, do I get this error message:
cdcHolder temp;
temp.cdcPointer = pDC; // pDC is of type CDC*
error LNK2001: unresolved external symbol "public: static class CDC * cdcHolder::cdcPointer" (?cdcPointer@cdcHolder@@2PAVCDC@@A)
I don't get it. I'm not trying to do something really stupid am I? All I want is to set a static member variable and it's driving me crazy!
Any help VERY much appreciated,
Gus
class cdcHolder
{
public:
cdcHolder();
virtual ~cdcHolder();
static CDC* cdcPointer;
};
And implementation.....
cdcHolder::cdcHolder() {}
cdcHolder::~cdcHolder() {}
Why, when I do the following in a seperate file, do I get this error message:
cdcHolder temp;
temp.cdcPointer = pDC; // pDC is of type CDC*
error LNK2001: unresolved external symbol "public: static class CDC * cdcHolder::cdcPointer" (?cdcPointer@cdcHolder@@2PAVCDC@@A)
I don't get it. I'm not trying to do something really stupid am I? All I want is to set a static member variable and it's driving me crazy!
Any help VERY much appreciated,
Gus