linking error with static templated member

Ian Lance Taylor iant@google.com
Tue Jan 29 04:05:00 GMT 2008


"Akos Rajna" <akimaki23@gmail.com> writes:

> and the linker is saying that Singleton<NetworkManager>::singleton is undefined

The C++ language requires a definition of the static class variable,
to go with the declaration.  I didn't see that in your code snippet.

template<class O> SingletonInstance<O> singleton;

Ian



More information about the Gcc-help mailing list