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: undefined reference


> =============================================================================
> 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


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