hello there,
I have a problem with static class memeber initialization.
I do the following:
std::string ClassA::sDummy
= ClassFactory<string,Module>
::RegisterCreatorFunction(std::string( "ClassA" ), ClassA::CreatorFunction );
this registers the creator function of the ClassA class to a map with "ClassA" as key. I use this for dynamic class instantiation. This means, I can create an instance of ClassA by just knowing the "ClassA" string (loading class according to a config file).
Well, this all worked fine as long as I used the GNU C compiler gcc/g++. I had to switch to the borland compiler bcc32 and since then it does not work any more. The RegisterCreatorFunction is never called!! Why are static class members not initialized at programm startup??
anybody got an idea? thanks a lot..
harald
I have a problem with static class memeber initialization.
I do the following:
std::string ClassA::sDummy
= ClassFactory<string,Module>
::RegisterCreatorFunction(std::string( "ClassA" ), ClassA::CreatorFunction );
this registers the creator function of the ClassA class to a map with "ClassA" as key. I use this for dynamic class instantiation. This means, I can create an instance of ClassA by just knowing the "ClassA" string (loading class according to a config file).
Well, this all worked fine as long as I used the GNU C compiler gcc/g++. I had to switch to the borland compiler bcc32 and since then it does not work any more. The RegisterCreatorFunction is never called!! Why are static class members not initialized at programm startup??
anybody got an idea? thanks a lot..
harald