This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: linking problems


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]