This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Undefined reference to static member in templated class
- To: Arun Saini <arunsaini at yahoo dot com>
- Subject: Re: Undefined reference to static member in templated class
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Wed, 18 Jul 2001 15:25:00 -0400
- cc: gcc at gcc dot gnu dot org
>>>>> Arun Saini writes:
Arun> I am using gcc-2.95.3 on AIX 4.3.3 / RS/6000. I am enclosing here a small
Arun> piece of code that compiled and executed correctly on gcc-3.0 on a Linux
Arun> system. It however fails on the AIX system.
GCC has known problems with templates on AIX because GCC does not
have a very advanced template generation facility and relies on WEAK
symbols to clean up after it. AIX does not provide WEAK symbols.
For AIX, one needs to use -fno-implicit-templates option for GCC
and explicitly instantiate the necessary templates in the code.
David