Okay, I've been struggling around with this for a day, I cannot find the solution. Here is my class declaration:
and my cpp file:Code:class CRTLight { public: CRTLight() {Lights++; } ~CRTLight() {Lights--; } void Pu****(); static int Lights; static vector<CRTLight*> vList; };
The compiler (VC++6) complains:Code:int CRTLight::Lights = 0; void CRTLight::Pu****() { vList.push_back(this); }
rLight.obj : error LNK2001: unresolved external symbol "public: static class std::vector<class CRTLight *,class std::allocator<class CRTLight *> > CRTLight::vList" (?vList@CRTLight@@2V?$vector@PAVCRTLight@@V?$alloc ator@PAVCRTLight@@@std@@@std@@A)
../bin/rEngine.dll : fatal error LNK1120: 1 unresolved externals
But if I remove the push_back call, it is ok, but i need the call
Any ideas?