
Initialization of static data member of template class
In the "standalone" initial build of our application, we successfully used
the following code:
// getTheBuilderCatalog - get a reference to the builder catalog
template <class AbstractClass, class Key, class Params>
OMMap <Key, AbstractBuilder <AbstractClass, Key, Params>*>& AbstractBuilder
<AbstractClass, Key, Params> :: getTheBuilderCatalog ()
{
static OMMap <Key, AbstractBuilder <AbstractClass, Key, Params>*>
theBuilderCatalog;
return theBuilderCatalog;
Quote:
}
Now, I'm attempting to build this as a library, then link to the (new)
application GUI. There are no compile errors (as I'd expect: nothing
changed!), but at runtime, it appears that this returns a null reference.
Any suggestions as to why the "standalone" version returns a valid
reference, but the attempt to incorporate this into a library returns a null
reference? I've checked my linker options several times, but find no
(obvious) explanation there...
Thanks for any suggestions,
Mark