This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: linking problems
- To: Jiann-Ming Su <js1 at microwave dot ph dot msstate dot edu>
- Subject: Re: linking problems
- From: Alexandre Oliva <aoliva at cygnus dot com>
- Date: 20 Apr 2000 21:33:03 -0300
- Cc: gcc at gcc dot gnu dot org
- Organization: Cygnus Solutions, a Red Hat Company
- References: <Pine.LNX.4.10.10004201835090.22605-100000@microwave.ph.msstate.edu>
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