Original Post
Hey guys when I declare an object in my class as static I get some unresolved external errors.
I have a Counter class which on creation initializes it''s counter to 0. I was hoping to create a static instance of this as a object in another class so that each time an object of this type is created, i can increment the static counter.
basically the structure of the code is:
class Counter
{
public:
UINT m_Counter;
Counter(){m_Counter = 0;}
~Counter(){}
UINT GetCounter(){ return m_Counter }
};
and i''m trying to do
class BaseObject
{
public:
static Counter myCounter;
...
}
why can''t i do this?