This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]