TMVA unresolved external symbol fgConfigPtr


We have a standalone application which uses ROOT and the TMVA library, which we can compile and link successfully on linux (RHEL4 gcc 3.4) but not on windows (VC++ 7.1). The resulting error is:
unresolved external symbol "private: static class TMVA::Config* TMVA::Config::fgConfigPtr

We typically compile ROOT ourselves - I receive this error when using ROOT 5.20.00. I also downloaded the binary distribution of v5.24.00 and got the same result.

Has anyone else had a similar issue?


This is a problem with TMVA under Windows. I have now fixed the problem in the SVN trunk.
Because on Windows an inline function cannot get or access a global variable
the two following functions have been moved to the implementation file.

static Config& Instance(); static void DestroyInstance();
with the following implementation:

void TMVA::Config::DestroyInstance()
// static function: destroy TMVA instance
if (fgConfigPtr != 0) { delete fgConfigPtr; fgConfigPtr = 0;}

TMVA::Config& TMVA::Config::Instance()
// static function: returns TMVA instance
return fgConfigPtr ? fgConfigPtr :(fgConfigPtr = new Config());

You can patch your version with this change. Please let me know if this fixes the problem.[/code]


Dear Rene,

I tried out the update and recompiled - that works just fine now on windows.

Thank you very much!
Take care,