I have a code which is similar to this:
#include <iostream>
class parent
{
public:
parent()
//does initializations here
{
start();
}
virtual void start()=0;
}
class child :public parent
{
public:
child()
{}
void start()
{
std::cout << "starting.." << std::endl;
}
}
Calling the start()
function in the constructor of parent class causes a linkage error (unresolved external symbol). I thought this wouldn't be a problem, why does it? Is there an alternative way rather than calling the start()
function manually after construction?