Re: Unsatisfied symbols for inline pure virtual overloads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tom,

Since Derived does not have a non-inlined virtual function, and since it's
virtual if it is called through a Base pointer or reference the compiler
needs to link to the actual function.

You probably need this switch...
-fkeep-inline-functions
...but my recommended solution is:  don't inline your virtual functions.  My
general guideline is:  never inline anything until you've done profiling to
show that it should be inlined for a needed performance gain.

Also, I strongly recommend you put in a virtual destructor in your Base
class.

Did you know that the g++ compiler generates the virtual function table in
the translation unit that has the first non-inlined virtual function
defined?  In the case where you don't have that, I suppose it emits a weak
linked or once-only linked virtual function table in all translation units.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux