Undefined References

Tom Browder tom.browder@gmail.com
Sat Dec 1 15:43:00 GMT 2007


On Dec 1, 2007 9:34 AM, Michael Sullivan <michael@espersunited.com> wrote:
...
> The virtual destructor is there because g++ was giving me a warning
> about setCurrentSprite(int), which will be implemented in classes Ally
> and Enemy - both descended from Character.  I've commented out the
> virtual destructor in character.h and used your Makefile with the
> following output:

Then problem is Character needs to have the virtual function defined,
even if it does nothing.  So:

  make the destructor virtual:

  virtual ~Character(){}

  define the virtual function:

 virtual void setCurrentSprite(int){} // not '{}' and not ';'

-Tom



More information about the Gcc-help mailing list