# Opening TMVA GUI when the executable is compiled using \`make\` command

**URL:** <https://root-forum.cern.ch/t/opening-tmva-gui-when-the-executable-is-compiled-using-make-command/24493>\
**Category:** TMVA\
**Tags:** graphics\
**Created:** [April 20, 2017, 9:25pm UTC](https://root-forum.cern.ch/t/opening-tmva-gui-when-the-executable-is-compiled-using-make-command/24493 "2017-04-20T21:25:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajat\_Mondal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rajat_mondal/32/21689_2.png) [@Rajat\_Mondal](https://root-forum.cern.ch/u/Rajat_Mondal)\
**Post date:** [April 20, 2017, 9:25pm UTC](https://root-forum.cern.ch/t/opening-tmva-gui-when-the-executable-is-compiled-using-make-command/24493/1 "2017-04-20T21:25:45Z")

</div>

Hi,

I can successfully compile and run the `TMVAClassification.C` file given in the directory `/root/tutorials/tmva` using the command `$ make TMVAClassification; ./TMVAClassification`. But despite having this line in the code:

```auto
//Launch the GUI for the root macros
   if (!gROOT->IsBatch()) TMVA::TMVAGui( outfileName );

```

no GUI appears after the completion. However, if I run: `$ root TMVAClassification.C`, The GUI opens at programme completion. I need to be able to do that because I will eventually use other libraries in the same code. Someone help please?

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [April 21, 2017, 7:45am UTC](https://root-forum.cern.ch/t/opening-tmva-gui-when-the-executable-is-compiled-using-make-command/24493/2 "2017-04-21T07:45:34Z")

</div>

Hi,

A TApplication is needed when creating a standalone application. Try to change `TMVAClassification.C` this way:

```auto
int main( int argc, char** argv )
{
   TApplication theApp("TMVAClassification", &argc, argv);
   // Select methods (don't look at this code - not of interest)
   TString methodList;
   for (int i=1; i<argc; i++) {
      TString regMethod(argv[i]);
      if(regMethod=="-b" || regMethod=="--batch") continue;
      if (!methodList.IsNull()) methodList += TString(",");
      methodList += regMethod;
   }
   int ret = TMVAClassification(methodList);
   theApp.Run();
   return ret;
}

```

Cheers, Bertrand.

---

<div class="post-metadata">

**Author:** ![Rajat\_Mondal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rajat_mondal/32/21689_2.png) [@Rajat\_Mondal](https://root-forum.cern.ch/u/Rajat_Mondal)\
**Post date:** [April 21, 2017, 9:35am UTC](https://root-forum.cern.ch/t/opening-tmva-gui-when-the-executable-is-compiled-using-make-command/24493/3 "2017-04-21T09:35:22Z")

</div>

Thanks for clarifying that. And I needed to add

```auto
#include "TApplication.h"

```

at the beginning of the code.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [April 21, 2017, 9:36am UTC](https://root-forum.cern.ch/t/opening-tmva-gui-when-the-executable-is-compiled-using-make-command/24493/4 "2017-04-21T09:36:43Z")

</div>

Indeed… And you’re welcome 🙂
