This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Undefined reference to C++ template static data members
Thanks for the comment Axel.
You are indeed correct, the initialisation of the array was incorrect.
When I changed
template <> DiffservService
ServiceManager<DiffservService,DiffservServiceId,MAX_SERVICE_DS>::s_all[
MAX_SERVICE_DS ];
to
template <> DiffservService
ServiceManager<DiffservService,DiffservServiceId,MAX_SERVICE_DS>::s_all[
MAX_SERVICE_DS ] = { };
The link error went away.
Cheers
Arthur
--
View this message in context: http://old.nabble.com/Undefined-reference-to-C%2B%2B-template-static-data-members-tp28841884p28879095.html
Sent from the gcc - Help mailing list archive at Nabble.com.