undefined reference
Martin von Loewis
martin@mira.isdn.cs.tu-berlin.de
Mon Jul 20 16:36:00 GMT 1998
> =============================================================================
> 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
More information about the Gcc
mailing list