# How exactly does ROOT work

**URL:** <https://root-forum.cern.ch/t/how-exactly-does-root-work/39509>\
**Category:** Newbie\
**Created:** [May 20, 2020, 1:19pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509 "2020-05-20T13:19:22Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![esh187](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/esh187/32/24961_2.png) [@esh187](https://root-forum.cern.ch/u/esh187)\
**Post date:** [May 21, 2020, 12:23pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/21 "2020-05-21T12:23:07Z")

</div>

Community Version

---

<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:** [May 21, 2020, 12:24pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/22 "2020-05-21T12:24:55Z")

</div>

The exact compete version. For example `16.5.4`, or `16.6.0` (this is printed when you start a command prompt for VS

---

<div class="post-metadata">

**Author:** ![esh187](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/esh187/32/24961_2.png) [@esh187](https://root-forum.cern.ch/u/esh187)\
**Post date:** [May 21, 2020, 12:25pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/23 "2020-05-21T12:25:15Z")

</div>

Visual Studio 2019 Developer Command Prompt v16.5.5

---

<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:** [May 21, 2020, 12:26pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/24 "2020-05-21T12:26:54Z")

</div>

Then I’m out of ideas… Can you run the tutorials?

---

<div class="post-metadata">

**Author:** ![esh187](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/esh187/32/24961_2.png) [@esh187](https://root-forum.cern.ch/u/esh187)\
**Post date:** [May 21, 2020, 12:28pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/25 "2020-05-21T12:28:18Z")

</div>

It does basic addition and such but it cannot do anything else really. Is there a way I can use ROOT on windows using WSL such Ubuntu or something?

---

<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:** [May 21, 2020, 12:30pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/26 "2020-05-21T12:30:37Z")

</div>

> [@esh187](#):
>
> It does basic addition and such but it cannot do anything else really.

So even the tutorials don’t work?

> [@esh187](#):
>
> Is there a way I can use ROOT on windows using WSL such Ubuntu or something?

Yes, but I have no experience with it. If you want to try, just search on this forum, there are several topics about it

---

<div class="post-metadata">

**Author:** ![esh187](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/esh187/32/24961_2.png) [@esh187](https://root-forum.cern.ch/u/esh187)\
**Post date:** [May 21, 2020, 12:34pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/27 "2020-05-21T12:34:30Z")

</div>

What about using a virtual machine? Could you help me out with that?

---

<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:** [May 21, 2020, 12:35pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/28 "2020-05-21T12:35:07Z")

</div>

Can you tell me if you can run any of the tutorials?

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [May 21, 2020, 12:41pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/29 "2020-05-21T12:41:19Z")

</div>

> [@esh187](#):
>
> It does basic addition and such but it cannot do anything else really. Is there a way I can use ROOT on windows using WSL such Ubuntu or something?

Check here for ROOT with WSL:

> [@Complete ROOT Installation Instructions for WSL (Ubuntu 18.04 on Windows 10)](https://root-forum.cern.ch/t/complete-root-installation-instructions-for-wsl-ubuntu-18-04-on-windows-10/35148):
>
> From @olifre : Install WSL ( [https://aka.ms/install](https://aka.ms/install) ) and then Ubuntu 18.04 from the Windows Store. The first step is not needed anymore for most recent Windows 10 versions, I think. Start the freshly installed Ubuntu Bash shell and install the dependencies and some build tools: sudo apt update && sudo apt dist-upgrade sudo apt install build-essential libtbb-dev libtiff5 x11-apps git Now there’s no graphics, since WSL does not ship any X server. You can fix that e.g. by installing [Xming](https://sourceforge.net/projects/xming/) and…

If you get an error from the second command in step 2, add “–fix-missing”, like this:  
`sudo apt install build-essential libtbb-dev libtiff5 x11-apps git --fix-missing`  
It works well with Ubuntu 18.04; I haven’t tried with 20.04 but should work --I tried the compiled version for 18.04 on a ‘real’ Unbuntu 20.04 and it works.

---

<div class="post-metadata">

**Author:** ![esh187](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/esh187/32/24961_2.png) [@esh187](https://root-forum.cern.ch/u/esh187)\
**Post date:** [May 21, 2020, 3:00pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/30 "2020-05-21T15:00:01Z")

</div>

I am not able to run the tutorials // It still shows undeclared identifier cout and endl //

---

<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:** [May 21, 2020, 3:08pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/31 "2020-05-21T15:08:17Z")

</div>

Can you try tutorials not using `cout` or `endl`, like for example `${ROOTSYS}/tutorials/hist/hsimple.C`?

---

<div class="post-metadata">

**Author:** ![esh187](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/esh187/32/24961_2.png) [@esh187](https://root-forum.cern.ch/u/esh187)\
**Post date:** [May 21, 2020, 3:09pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/32 "2020-05-21T15:09:41Z")

</div>

I was able to run this one just fine. It was one of the demos right? I tried th demos available and they all worked just fine.

---

<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:** [May 21, 2020, 3:13pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/33 "2020-05-21T15:13:53Z")

</div>

So what did you try exactly? I asked you to try the tutorials and you said:

> [@esh187](#):
>
> I am not able to run the tutorials // It still shows undeclared identifier cout and endl //

And now you say:

> [@esh187](#):
>
> I was able to run this one just fine. It was one of the demos right? I tried th demos available and they all worked just fine.

So I’m a bit confused…

---

<div class="post-metadata">

**Author:** ![esh187](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/esh187/32/24961_2.png) [@esh187](https://root-forum.cern.ch/u/esh187)\
**Post date:** [May 21, 2020, 3:15pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/34 "2020-05-21T15:15:54Z")

</div>

I thought you meant the tutorials from:  
[https://root.cern/doc/master/group\_\_Tutorials.html](https://root.cern/doc/master/group__Tutorials.html)

The demos were accessed using ’ .demo ’ right? I could run those without any issue. I just had to click on whichever one I wanted no particular coding was involved as such.

---

<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:** [May 21, 2020, 3:17pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/35 "2020-05-21T15:17:44Z")

</div>

> [@esh187](#):
>
> The demos were accessed using ’ .demo ’ right?

No, I was meaning the tutorials in `${ROOTSYS}/tutorials`, in your `root` directory

---

<div class="post-metadata">

**Author:** ![esh187](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/esh187/32/24961_2.png) [@esh187](https://root-forum.cern.ch/u/esh187)\
**Post date:** [May 21, 2020, 3:19pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/36 "2020-05-21T15:19:39Z")

</div>

I haven’t tried. What is the command prompt to execute it?

---

<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:** [May 21, 2020, 3:27pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/37 "2020-05-21T15:27:21Z")

</div>

go to the directory containing the tutorial you want to execute, start root, and type `.x tutorial_name.C`  
For example:

```auto
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.4.6
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'

C:\Users\bellenot>build\release\bin\thisroot.bat

C:\Users\bellenot>cd %ROOTSYS%\tutorials

C:\Users\bellenot\build\release\tutorials>root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.23/01 https://root.cern |
  | (c) 1995-2020, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for win32 on May 20 2020, 18:23:44 |
  | From heads/master@v6-23-01-7-g35105feb3d |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

Welcome to the ROOT tutorials

Type ".x demos.C" to get a toolbar from which to execute the demos

Type ".x demoshelp.C" to see the help window

==> Many tutorials use the file hsimple.root produced by hsimple.C
==> It is recommended to execute hsimple.C before any other script

root [0] .x hsimple.C
hsimple : Real Time = 0.93 seconds Cpu Time = 0.92 seconds
(TFile *) 0xcf7a230
root [1] .q

Taking a break from ROOT? Hope to see you back!

C:\Users\bellenot\build\release\tutorials>

```

And you can try with the other tutorials in sub-directories as well

---

<div class="post-metadata">

**Author:** ![esh187](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/esh187/32/24961_2.png) [@esh187](https://root-forum.cern.ch/u/esh187)\
**Post date:** [May 21, 2020, 3:46pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/38 "2020-05-21T15:46:36Z")

</div>

Alright I’ll try that  
Do you have any idea why the cout and endl won’t be identified ?

---

<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:** [May 21, 2020, 3:47pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/39 "2020-05-21T15:47:13Z")

</div>

No idea…

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [May 21, 2020, 3:48pm UTC](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509/40 "2020-05-21T15:48:44Z")

</div>

Hi,  
You can try executing `using namespace std;` at the ROOT prompt before you run a tutorial, or change `cout` and `endl` to `std::cout` and `std::endl`.

[Previous page](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509.md?page=1)

[Next page](https://root-forum.cern.ch/t/how-exactly-does-root-work/39509.md?page=3)
