X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: Raf256 Newsgroups: comp.os.msdos.djgpp Subject: templates export ? Date: 7 Dec 2001 09:18:01 GMT Organization: aa Lines: 32 Sender: raf256 AT poczta DOT onet DOT pl@chello062179025129.chello.pl Message-ID: NNTP-Posting-Host: chello062179025129.chello.pl Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8bit X-Trace: news.onet.pl 1007716681 2396 62.179.25.129 (7 Dec 2001 09:18:01 GMT) X-Complaints-To: abuse AT onet DOT pl NNTP-Posting-Date: 7 Dec 2001 09:18:01 GMT User-Agent: Xnews/4.06.22 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Sorry for such a lame question, but it's first time im using templates in bigger project. I have problems with external templates, afair this problem was connected to 'export' (?) and solving it in 'nice' way was impossible until release of GCC 3.02 I have project like : (I'm writting from mmemory) --- lib.h --- template class cTest { public : typ a; cTest(); }; --- lib.cpp --- #include "lib.h" template cTest::cTest() { a=0; } --- main.cpp --- #include "lib.h" int main() { cTest a; } Project file has 2 sources : lib.cpp and main.cpp Compile is ok, but linker reports that he can't find cTest::cTest(); Ofcourse if I would put all 3 files into one and if I didnt use project - everything would be ok. How can I solve this problem (how to use template class from my library) Thanks ! -- Raf256 ############################################################## ,--, _ ,- _ _ _ ############################################### |,-'`_|_|_ `_||_'|_' # raf256 AT go2 DOT pl ## :( ######################### | `\|_| | |_,,_||_| ###############################################