[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Q about g++-3 and template instantiation

> Why use 'preprocessor switch'? AFAIK g++-2 should hanlde correct
> syntax too (without keyword 'template'). At least version 2.95.3 does
> compiles your example code with 'template' removed. Did you tried to
> compile your application with g++-2 with 'template' removed where it
> should be removed? If it will not compile and link I will be
> surprised.

Yes, I tried it in g++-2 without 'template', and it compiles fine, but
the application won't link that way.  It makes errors like the
following, with g++2.96.  That's why I put in the things to test which
g++ I have.  Thanks again for the help.  Dan.

stats.o: In function `__default_alloc_template<true, 0>::_Lock::~_Lock(void)':
/usr/include/g++-3/stl_alloc.h(.void gnu.linkonce.t.sort<double *>(double *, double *)+0x4c): undefined reference to `void __introsort_loop<double *, double, int>(double *, double *, double *, int)'
/usr/include/g++-3/stl_alloc.h(.void gnu.linkonce.t.sort<double *>(double *, double *)+0x5d): undefined reference to `void __final_insertion_sort<double *>(double *, double *)'

Dan E. Kelley                                     phone:(902)494-1694
Oceanography Department, Dalhousie University       fax:(902)494-2885
Halifax, Nova Scotia                         mailto:Dan.Kelley@Dal.CA
Canada B3H 4J1   http://www.phys.ocean.dal.ca/~kelley/Kelley_Dan.html

Reply to: