# TMVA unresolved external symbol fgConfigPtr

**URL:** <https://root-forum.cern.ch/t/tmva-unresolved-external-symbol-fgconfigptr/9554>\
**Category:** TMVA\
**Created:** [January 27, 2010, 9:17pm UTC](https://root-forum.cern.ch/t/tmva-unresolved-external-symbol-fgconfigptr/9554 "2010-01-27T21:17:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![heather625](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/74df32/32.png) [@heather625](https://root-forum.cern.ch/u/heather625)\
**Post date:** [January 27, 2010, 9:17pm UTC](https://root-forum.cern.ch/t/tmva-unresolved-external-symbol-fgconfigptr/9554/1 "2010-01-27T21:17:48Z")

</div>

Hi,

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?

Thanks,  
Heather

---

<div class="post-metadata">

**Author:** ![brun](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/b9e5f3/32.png) [@brun](https://root-forum.cern.ch/u/brun)\
**Post date:** [January 28, 2010, 7:16am UTC](https://root-forum.cern.ch/t/tmva-unresolved-external-symbol-fgconfigptr/9554/2 "2010-01-28T07:16:22Z")

</div>

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:

[code]//\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
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]

Rene

---

<div class="post-metadata">

**Author:** ![heather625](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/74df32/32.png) [@heather625](https://root-forum.cern.ch/u/heather625)\
**Post date:** [February 1, 2010, 1:31pm UTC](https://root-forum.cern.ch/t/tmva-unresolved-external-symbol-fgconfigptr/9554/3 "2010-02-01T13:31:02Z")

</div>

Dear Rene,

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

Thank you very much!  
Take care,  
Heather
