public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* c++ template class problem
@ 1998-09-23  8:43 Toshinao ISHII
  1998-09-24  2:37 ` Alexandre Oliva
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Toshinao ISHII @ 1998-09-23  8:43 UTC (permalink / raw)
  To: egcs

Hi. I have just started using template in g++.

I tried compiling the following C++ source using template.
g++ (egcs-2.92.07) give the following error.

g++ -c poi01.C -g -frepo
g++ -o poi01 poi01.o
poi01.o: In function `main':
/ici/work/test_template/poi01.C:27: undefined reference to \
    `ostream & operator<<<double>(ostream &, C<double> const &)'
/ici/work/test_template/poi01.C:27: undefined reference to \
    `ostream & operator<<<double>(ostream &, C<double> const &)'
collect2: ld returned 1 exit status
gmake: *** [poi01] Error 1

It look g++ fail to instantiate the template function. In addition,
the second parameter "C<double> const &" should be
"const C<double> &". 

Please let me know how to implement the template function.

Thanks in advance.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
^[$B@P0f=SD>^[(B   Toshinao Ishii

   Advanced Technology R&D Center (ATC)   ^[$B;0I)EE5!^[(B(^[$B3t^[(B)
   Mitsubishi Electric Corporation        ^[$B@hC

^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <199809231033.TAA06844.cygnus.egcs@rothko.qua.srl.melco.co.jp>]

end of thread, other threads:[~1998-09-25 22:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-23  8:43 c++ template class problem Toshinao ISHII
1998-09-24  2:37 ` Alexandre Oliva
1998-09-24  3:26   ` Toshinao Ishii
1998-09-25 15:38 ` Todd Vierling
     [not found] ` <Pine.NEB.4.02.9809251448310.2414-100000.cygnus.egcs@duhnet.net>
1998-09-25 20:49   ` Jason Merrill
1998-09-25 22:53     ` Todd Vierling
     [not found] <199809231033.TAA06844.cygnus.egcs@rothko.qua.srl.melco.co.jp>
1998-09-24 19:20 ` Nathan Myers
1998-09-25 22:53   ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).