Re: initializing static members of class
On May 28, 7:30 pm, Erik Wikstr=F6m <eri...@student.chalmers.se> wrote:
On 28 Maj, 16:25, "John" <prakash.mi...@gmail.com> wrote:
is there any compiler option for g++ for initializing static members of=
Due to some unknown reason, static member in one of our c++ applicatio=
not getting initialized properly.
Most probable reason for this is that you do not initialize it in the
code, but you have not shown us any code so we can't tell.
Here is the code:
Application is using below mentioned template class which is declared
as static in RuleEngine.h class file.
static RWTPtrHashDictionary<RWCString, RuleClass
RWTPtrHashDictionary<RWCString, RuleClass RWDefHArgs(RWCString)>
Above line definition/initialization for ruleHash is found in
RuleEngine.C at the beginning of the file.
Here is sample piece of code where ruleHash is used. This code is
RuleEngine.C. I am calling insertRule(this) static method from
RuleClass.h class file.
Void RuleEngine::insertRule( RuleClass* newRule )
RuleClass* rule = NULL;
if( 0 != ruleHash.entries() )
Application is using template object ruleHash to call entries()
I am getting core dump at releHash.entries() line. Its not only with
entries method, it crashes for any methods of RWTPtrHashDictionary.
I have also tried with other template class RWTValDlist<RWCString> to
test whether it is problem with deprecated RWTPtrHashDictionary
But I see that application crashes for RWTValDlist template too.
Please help me.