Problem with static in templates

Johannus Noordanus johannes_noordanus@tasking.nl
Wed Jan 6 07:10:00 GMT 1999


When compiling the test.cc program (see attachment), the following
loader error occurred:

AVL/TEST > g++ test.cc
/tmp/cca296381.o: In function `X<int>::X(int)':
/tmp/cca296381.o(.X<int>::gnu.linkonce.t.(int)+0x7): undefined reference
to `X<int>::s'
collect2: ld returned 1 exit status

It seems that the use of static variables within template classes is not
permitted!

I hope you will look into this problem.
Thanks,

-- 
Johannes Noordanus                                 Software Engineer
----------------------------------------------------------------------
voice:  +31 33 455 85 84                           Tasking Software BV
fax:    +31 33 455 86 12                           Plotterweg 31
email:  Johannes_Noordanus@tasking.com             3821 BB  Amersfoort
WWW:    http://www.tasking.com                     The Netherlands
------------> Quality Development Tools Worldwide <-------------------



More information about the Gcc-bugs mailing list