Click to See Complete Forum and Search --> : Linking error when deriving class from COleDateTIme in VC++ 7.0


NN_PP
July 24th, 2004, 03:01 AM
I had derived a class from COleDateTime in VC6.0
Now I wanted to move this in VC 7.0.
So upon building this in VC7.0 I got an linking error which indicates that error LNK2019: unresolved external symbol "protected: void __thiscall ATL::COleDateTime::CheckRange(void)" (?CheckRange@COleDateTime@ATL@@IAEXXZ) referenced in function "public: __thiscall MilliOleDateTime::MilliOleDateTime(class ATL::COleDateTime const &,int)" (??0MilliOleDateTime@@QAE@ABVCOleDateTime@ATL@@H@Z)
../../Executables/Debug/MilliTime.dll : fatal error LNK1120: 1 unresolved externals

This means that the CheckRange protected function of the COleDateTime was not referenced.
I was making a call of CheckRange inside some functions which was been derived from the COleDateTime.
A simple example of how this linking error can be obtained is as follows
class CTest : public COleDateTime
{
public:
CTest(){COleDateTime::CheckRange();};
};

CTest a;
Up on compilation of this u will get the linking error. This works fine for the VC6.0 only this is u need to have the MFC support.
I wasnt able to find any solution for this, can any one provide me help?