linking problems

Alexandre Oliva aoliva@cygnus.com
Thu Apr 20 17:33:00 GMT 2000


On Apr 20, 2000, Jiann-Ming Su <js1@microwave.ph.msstate.edu> wrote:

> /usr/include/g++-2/stl_algobase.h:121: undefined reference to `CSomeDerivedClass::MemberFunction(void)'

> The strange thing is this code had linked previously.  I've added new
> code, but none relating to this function.

Is this member function inline?  Did you add some non-inline methods
to the same class?  GCC uses heuristics to emit out-of-line copies of
inline methods: they're only emitted in the translation unit
containing the first non-inline non-abstract member function of the
class.  This assumption is valid because the C++ Standard requires
every non-abstract member function to be defined.

-- 
Alexandre Oliva    Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me



More information about the Gcc mailing list