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: v3 template errors


Hi Alonzo,

I think that the programs in v3template-error.tar.gz
are not completely conforming to standard C++, because
of the definitions of template methods in .C files
which are compiled separately (in SomeTemplate.C and
SimpleList.C). Whenever you have that kind of definition,
it must be preceded by the "export" keyword, or your
programs won't link. This is better explained in
section 13.7 of "The C++ Programming Language (3rd edition)".
In principle the SGI compiler should have complained about
your code.

Unfortunately the export keyword is one of the few standard C++
features which have not yet been implemented in gcc, so I fear
this won't help you much. Your best bet is to rearrange the
source code (e.g. move the definitions of the template members
into the headers).

Hope this helps a bit,
  Martin


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