From: "Steve Ball" Newsgroups: comp.os.msdos.djgpp Subject: Can't specify initial value for template static fields Date: Mon, 12 Jul 1999 09:22:03 +1200 Organization: Customer of Telecom Internet Services Lines: 31 Message-ID: <7mb1u0$4pr21$1@titan.xtra.co.nz> NNTP-Posting-Host: 210-55-123-47.dialup.xtra.co.nz X-Trace: titan.xtra.co.nz 931728128 5041217 210.55.123.47 (11 Jul 1999 21:22:08 GMT) X-Complaints-To: abuse AT xtra DOT co DOT nz NNTP-Posting-Date: 11 Jul 1999 21:22:08 GMT X-Newsreader: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Is there any reason why I can't specify an initial value for a static field of a templated class? template class X { public: static int n; }; template int X::n; void main() { X t; cout << t.n; } This works fine, but if n is given an initial value: template int X::n = 1; then the linker complains that X::n is an undefined symbol. What am I missing here?