Can someone explain what I'm doing wrong?
The following simple snippet illustrates my problem. The linker gives the error "unresolved external symbol 'private: static int CStaticTest::m_Count' ". I'm using VC++ 6.
class CStaticTest
{
public:
CStaticTest();
~CStaticTest();
private:
static int m_Count;
};
CStaticTest::CStaticTest()
{
m_Count++;
}
CStaticTest::~CStaticTest()
{
m_Count--;
}