This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Template linking problem
- From: John Love-Jensen <eljay at adobe dot com>
- To: Harvey Chapman <hchapman-gcc-help at 3gfp dot com>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Wed, 07 Nov 2007 06:44:40 -0600
- Subject: Re: Template linking problem
Hi Harvey,
Your Singleton class forward declares a "static Type* ptr", but doesn't
actually allocate the space anywhere. (Unless you have it in a different
.cc file.)
Add this to your source file:
template <typename Type>
Type* Singleton<Type>::ptr;
HTH,
--Eljay