From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Boris" To: help-gcc@gnu.org Subject: problem with template and global/static variable Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: <831gvd$sov$1@news.rrz.Uni-Koeln.DE> X-SW-Source: 1999-12n/msg00196.html Message-ID: <19991231222400.pdfQfE43oOrYiPoX4CaFZM773lEQHVbwpsH0CJ7z-eU@z> I just come from comp.lang.c++ where they told me I should ask here as it must be a gcc linker problem. I hope you can help me. I created a template that I can only use as a member of an object. If I try to use a static or global variable of the template type I get a linking error (gcc 2.7): Clients.cpp:26: undefined reference to `Collector::Collector(void)' I have no idea why. It looks like that a constructor Collector(void) is needed? The Collector template has a public constructor Collector(). Can't this be used for global/static variables? Do I have to code another public constructor for Collector: a Collector(void)? Boris