# Undefined reference to \`TMVA::Tools::Instance()'

**URL:** <https://root-forum.cern.ch/t/undefined-reference-to-tmva-tools-instance/21899>\
**Category:** TMVA\
**Created:** [September 20, 2016, 11:55am UTC](https://root-forum.cern.ch/t/undefined-reference-to-tmva-tools-instance/21899 "2016-09-20T11:55:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![calbet](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@calbet](https://root-forum.cern.ch/u/calbet)\
**Post date:** [September 20, 2016, 11:55am UTC](https://root-forum.cern.ch/t/undefined-reference-to-tmva-tools-instance/21899/1 "2016-09-20T11:55:26Z")

</div>

Dear experts,

I want to compile the TMVAClassification() in my [main.cc](http://main.cc)[1] using a Makefile [2] but I git the error message [3]. Is some TMVA library missing in my Makefile?

Regards

[1]  
[calpas.web.cern.ch/calpas/main.cc](http://calpas.web.cern.ch/calpas/main.cc)

[2]  
[calpas.web.cern.ch/calpas/Makefile](http://calpas.web.cern.ch/calpas/Makefile)

[3]  
In function `TMVAClassification(TString)': main.cc:(.text+0x979): undefined reference to`TMVA:🛠:Instance()'  
collect2: error: ld returned 1 exit status  
Makefile:10: recipe for target ‘do.exe’ failed  
make: \*\*\* [do.exe] Error 1

---

<div class="post-metadata">

**Author:** ![behrenhoff](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/behrenhoff/32/12285_2.png) [@behrenhoff](https://root-forum.cern.ch/u/behrenhoff)\
**Post date:** [September 20, 2016, 12:38pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tmva-tools-instance/21899/2 "2016-09-20T12:38:24Z")

</div>

You need to link with `-lTMVA`

Also, consider using at least `-Wall -Wextra`

---

<div class="post-metadata">

**Author:** ![calbet](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@calbet](https://root-forum.cern.ch/u/calbet)\
**Post date:** [September 20, 2016, 3:29pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tmva-tools-instance/21899/3 "2016-09-20T15:29:55Z")

</div>

Dear behrenhoff,

it helps a lot, but I still have the error message [1]. Do you know which library is missing?

Regards

[1]  
undefined reference to `TMVA::TMVAGui(char const\*)’

---

<div class="post-metadata">

**Author:** ![Pepe\_Le\_Pew](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pepe_le_pew/32/12365_2.png) [@Pepe\_Le\_Pew](https://root-forum.cern.ch/u/Pepe_Le_Pew)\
**Post date:** [September 20, 2016, 3:34pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tmva-tools-instance/21899/4 "2016-09-20T15:34:50Z")

</div>

-lTMVAGui  
Note: you need ROOT 6.

---

<div class="post-metadata">

**Author:** ![calbet](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@calbet](https://root-forum.cern.ch/u/calbet)\
**Post date:** [September 20, 2016, 4:55pm UTC](https://root-forum.cern.ch/t/undefined-reference-to-tmva-tools-instance/21899/5 "2016-09-20T16:55:16Z")

</div>

Dear behrenhoff and Pepe,

all compile now. Thank you for your help.

Regards
