From: "Christopher Nelson" To: Subject: Re: Linking problem (undefined reference) Date: Fri, 26 Mar 1999 06:31:30 -0700 Message-ID: <01be778c$f55d1ec0$LocalHost@thendren> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Reply-To: djgpp AT delorie DOT com >I've created a new class called CSentence that has a list of >string. >list m_Words; is this a template? >While linking, LD displays the following error message: >d:/djgpp/tmp\ccdaaaaa(.text+0xe1c6):Sentence.cc: undefined reference to `list > >::operator=(list string_char_traits > > const &)' >What's the possible problem? How can I track down the problem? if you're using templates then, if you have the member functions defined outside of the class, you must do something like this to EXPLICITY instantiate the class: #include "templateclass.h" #include "templateclass.cc" template class mytemplateclass; Otherwise no code will get generated for it. This may also be the case if you use -fno-implicit-templates to compile.