0

I having a link error (unresolved external symbol) for a protected method (not virtual) being called in a virtual private method that I'm overwriting. The link error is solved by changing protected to public? I didn't found any info on that. Things goes like this:

class Base{
protected:
  void Finish();

private:          
  virtual void VOnUpdate()=0;
};

class Derived: public Base{
private:          
  virtual void VOnUpdate(){
    Finish();// unresolved Finish() being called
  }
};

With some tests I did I concluded that the problem is also solved if I define Finish() on the header file (where Base is declared). But I don't want nor can do that, as Finish needs a include that includes Base (would cause circular reference). But note this circular thing is not the problem, I created a dummy method just to confirm, it also creates the link error. I'm clueless.

Jonas
  • 6,915
  • 8
  • 35
  • 53
Icebone1000
  • 1,231
  • 4
  • 13
  • 25
  • You're not compiling the source file or not linking the generated object file. Next time please post the error message. It may mean nothing to you, but can help others help you. – Luchian Grigore May 24 '13 at 06:15
  • This really has nothing to do with `protected` or `private`, so you can greatly simplify the problem. – juanchopanza May 24 '13 at 06:16

0 Answers0