From: "Lars Hansen" Newsgroups: comp.os.msdos.djgpp References: <393176dd AT news DOT ivm DOT net> Subject: Re: template friend Date: Wed, 31 May 2000 21:36:40 +0200 Lines: 16 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-Mimeole: Produced By Microsoft MimeOLE V5.00.2919.6600 Organization: debitel.net - der Onlinedienst X-NNTP-Posting-Host: 62.54.41.190 NNTP-Posting-Host: mwnews.dnsg.net Message-ID: <393569cd@news.ivm.net> X-Trace: 31 May 2000 21:36:45 CET, mwnews.dnsg.net X-Complaints-To: usenet AT ivm DOT net X-Admin-Comment: X-NNTP-Posting... are valid if present To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com ' template friend class A; ' declares all 'A' s as a friend of the object this expression is used in. ' friend class A; ' declares specifically A as a friend. That should be ANSI-C++ and DJGPP 2.03 understands that. But the answer to your problem is different: a small forward-declaration is necessary: ' template class Two; ' That's what the debugger is saying: 'c' is undeclared, meaning its type is unknown (so far).