This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: undefined reference
- To: xiao at cmold dot com
- Subject: Re: undefined reference
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Tue, 21 Jul 1998 00:33:59 +0200
- CC: egcs at cygnus dot com
- References: <199807191750.NAA06127@spencer.actech.com>
> =============================================================================
> The error message is:
> /tmp/cca005831.o: In function `operator<<(ostream &, MyTest<float> const &)':
> /tmp/cca005831.o(.text+0x61): undefined reference to `operator<<(ostream &, smanip<int> const &)'
>
> =============================================================================
> The compile command is:
> gcc -fguiding-decls -fno-implicit-templates junk.cpp -L/usr/local/lib -lstdc++ -o junk
>
> Could anybody tell me what I should do to make this piece of code
> work? Thanks in advance.
Omit both -fguiding-decls and -fno-implicit-templates when
compiling. You should not need them.
If you absolutely want to use explicit instantiation, please read the
g++ FAQ for details.
Regards,
Martin