I have a class like:
Base.h
class Base {
public:
Base();
virtual int getInfo(int i);
protected:
int GetDetail (int iVal);
}
inline int Base::getInfo(int i){
int output = GetDetail(i);
return output;
};
Ib Base.cpp, I have the GetDetail defined.
int Base::GetDetail(int i){
int output;
// do work to output
return output;
}
I have some derived classes that call GetDetail from their own implementation getInfo().
When I remove the call to getInfo() from the virtual function definition in Base.h, the code will compile, with the derived classes own implementation.
When I compile with the virtual function calling GetDetail from the inlined virtual function, the linking fails with:
Undefinied reference to GetDetail.
Any ideas?