I have 4 classes:
Point inherits from Shape,Circle from Point and Cylinder from Circle.
point, circle, cylinder are objects to Point, Circle, Cylinder.
Shape *shapeVector[3];
shapeVector[0]=&point;
shapeVector[1] = &circle;
shapeVector[2] = &cylinder;
When I do this:
Shape *baseClassPtr=shapeVector[ 1 ];
baseClassPtr->GetName();
It is working.But when I do this:
virtualViaPointer( shapeVector[ i ] );
void virtualViaPointer( Shape *baseClassPtr )
{
cout << baseClassPtr->GetName() << ": " ;
}
I'm getting this error:
Error 2 error LNK1120: 1 unresolved externals
Error 1 error LNK2019: unresolved external symbol "void __cdecl virtualViaPointer(class Shape const *)" (?virtualViaPointer@@YAXPBVShape@@@Z) referenced in function _wmain