# Root terminal keeps disappearing on windows

**URL:** <https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106>\
**Category:** TMVA\
**Created:** [July 10, 2019, 10:29pm UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106 "2019-07-10T22:29:11Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Choma\_Joshua](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/choma_joshua/32/19201_2.png) [@Choma\_Joshua](https://root-forum.cern.ch/u/Choma_Joshua)\
**Post date:** [July 10, 2019, 10:29pm UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/1 "2019-07-10T22:29:11Z")

</div>

Hello

My terminal keeps disappearing on windows when running a TMVA script. I would appreciate some assistance as I am new to root. [LowCuts.C](https://root-forum.cern.ch/uploads/short-url/34qoPz5OodTiskioLdyWHhOSx8Z.C) (19.9 KB)

---

<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:** [July 11, 2019, 7:56am UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/2 "2019-07-11T07:56:00Z")

</div>

Hi,

Which version of ROOT? How do you execute your macro?

---

<div class="post-metadata">

**Author:** ![Choma\_Joshua](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/choma_joshua/32/19201_2.png) [@Choma\_Joshua](https://root-forum.cern.ch/u/Choma_Joshua)\
**Post date:** [July 11, 2019, 8:36am UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/3 "2019-07-11T08:36:07Z")

</div>

It is version 5.34.38

---

<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:** [July 11, 2019, 8:42am UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/4 "2019-07-11T08:42:14Z")

</div>

Here is what I get (after fixing your macro):

```auto
C:\Users\bellenot\Downloads\test>root
  *******************************************
  * *
  * W E L C O M E to R O O T *
  * *
  * Version 5.34/39 12 March 2018 *
  * *
  * You are welcome to visit our Web site *
  * http://root.cern.ch *
  * *
  *******************************************

ROOT 5.34/39 (heads/v5-34-00-patches@v5-34-38-1-g507abd2, Jul 11 2019, 09:12:00 on win32)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x LowCuts.C+
Info in <TWinNTSystem::ACLiC>: creating shared library C:\Users\bellenot\Downloads\test\LowCuts_C.dll
23144112_cint.cxx
LowCuts_C_ACLiC_dict.cxx
   Creating library C:\Users\bellenot\Downloads\test\LowCuts_C.lib and object C:\Users\bellenot\Downloads\test\LowCuts_C.exp

==> Start TMVAClassification
--- Factory : You are running ROOT Version: 5.34/39, Mar 12, 2018
--- Factory :
--- Factory : _/_/_/_/_/ _| _| _| _| _|_|
--- Factory : _/ _|_| _|_| _| _| _| _|
--- Factory : _/ _| _| _| _| _| _|_|_|_|
--- Factory : _/ _| _| _| _| _| _|
--- Factory : _/ _| _| _| _| _|
--- Factory :
--- Factory : ___________ TMVA Version 4.2.0, Sep 19, 2013
--- Factory :
Error in <TFile::TFile>: file ./R21_background.root does not exist
Error in <TFile::TFile>: file ./R21_A400_Z_vv_H250_yy.root does not exist

C:\Users\bellenot\Downloads\test>

```

And I had to add those lines in your macro:

```auto
#include "TInterpreter.h"
#include "TMVAGui.C"

```

And replace the `not` by `!` on this line:

```auto
#if !defined( __CINT__ ) || defined( __MAKECINT__ )

```

---

<div class="post-metadata">

**Author:** ![Choma\_Joshua](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/choma_joshua/32/19201_2.png) [@Choma\_Joshua](https://root-forum.cern.ch/u/Choma_Joshua)\
**Post date:** [July 11, 2019, 8:49am UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/5 "2019-07-11T08:49:08Z")

</div>

I have made the changes but it still disappears just few lines after the last line on the screenshot.

 ![Root](https://root-forum.cern.ch/uploads/default/original/3X/f/9/f9d21516f98a3bedf0b4a682af6706cd674abbbb.png)

---

<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:** [July 11, 2019, 9:02am UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/6 "2019-07-11T09:02:11Z")

</div>

You still didn’t tell how you start root.exe…

---

<div class="post-metadata">

**Author:** ![Choma\_Joshua](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/choma_joshua/32/19201_2.png) [@Choma\_Joshua](https://root-forum.cern.ch/u/Choma_Joshua)\
**Post date:** [July 11, 2019, 9:05am UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/7 "2019-07-11T09:05:51Z")

</div>

By clicking on the root app icon and the terminal appears on the screen.

---

<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:** [July 11, 2019, 9:38am UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/8 "2019-07-11T09:38:54Z")

</div>

OK, so please open a command prompt and start root from there, so you will see the error message, if any…

---

<div class="post-metadata">

**Author:** ![Choma\_Joshua](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/choma_joshua/32/19201_2.png) [@Choma\_Joshua](https://root-forum.cern.ch/u/Choma_Joshua)\
**Post date:** [July 11, 2019, 11:28am UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/9 "2019-07-11T11:28:12Z")

</div>

**I now get the error you got after you fixed those few lines even though I have the two root files it is complaining about.**

```auto
C:\Users\joshu>root
  *******************************************
  * *
  * W E L C O M E to R O O T *
  * *
  * Version 5.34/38 12 March 2018 *
  * *
  * You are welcome to visit our Web site *
  * http://root.cern.ch *
  * *
  *******************************************

ROOT 5.34/38 (v5-34-38@v5-34-38, Mar 12 2018, 15:49:39 on win32)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .x LowCuts.C
Error: Redefinition of default argument C:\root_v5.34.38\macros\TMVAGui.C(34)
***Interpreter error recovered***

==> Start TMVAClassification
--- Factory : You are running ROOT Version: 5.34/38, Mar 12, 2018
--- Factory :
--- Factory : _/_/_/_/_/ _| _| _| _| _|_|
--- Factory : _/ _|_| _|_| _| _| _| _|
--- Factory : _/ _| _| _| _| _| _|_|_|_|
--- Factory : _/ _| _| _| _| _| _|
--- Factory : _/ _| _| _| _| _|
--- Factory :
--- Factory : ___________ TMVA Version 4.2.0, Sep 19, 2013
--- Factory :
Error in <TFile::TFile>: file ./R21_background.root does not exist
Error in <TFile::TFile>: file ./R21_A400_Z_vv_H250_yy.root does not exist
Error: illegal pointer to class object inputS 0x0 43 C:\root_v5.34.38\macros\LowCuts.C(224)
***Interpreter error recovered***
root [1]

```

---

<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:** [July 11, 2019, 11:35am UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/10 "2019-07-11T11:35:28Z")

</div>

Are those files in the same directory than the macro is? Or in the current directory?

---

<div class="post-metadata">

**Author:** ![Choma\_Joshua](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/choma_joshua/32/19201_2.png) [@Choma\_Joshua](https://root-forum.cern.ch/u/Choma_Joshua)\
**Post date:** [July 11, 2019, 11:46am UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/11 "2019-07-11T11:46:43Z")

</div>

They are just outside the macros folder but I have tried running the macro with the files in the same directory too and it still failed. I removed the “./” in front of the file names when running it from the same directory.

---

<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:** [July 11, 2019, 11:51am UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/12 "2019-07-11T11:51:13Z")

</div>

Could you put all your files and macros in a common directory and start root from there?

---

<div class="post-metadata">

**Author:** ![Choma\_Joshua](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/choma_joshua/32/19201_2.png) [@Choma\_Joshua](https://root-forum.cern.ch/u/Choma_Joshua)\
**Post date:** [July 11, 2019, 12:30pm UTC](https://root-forum.cern.ch/t/root-terminal-keeps-disappearing-on-windows/35106/13 "2019-07-11T12:30:38Z")

</div>

Thanks very much, it is working now. Much appreciated
