[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.

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

DEK> stats.o: In function `__default_alloc_template<true, 0>::_Lock::~_Lock(void)':
DEK> /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)'
DEK> /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 *)'

I see. It is hard to tell what's wrong with it without look at
sources. It could be gcc bug.  AFAIK 2.95.xx versions had quite buggy
support for templates. It seems that you will have to use
'preprocessor switch' for compatiblity with old gcc.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)                                    |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/)                          |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Reply to: