# TMath.h is not found

**URL:** <https://root-forum.cern.ch/t/tmath-h-is-not-found/46819>\
**Category:** Newbie\
**Created:** [September 13, 2021, 8:07pm UTC](https://root-forum.cern.ch/t/tmath-h-is-not-found/46819 "2021-09-13T20:07:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![emilianozm24](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/emilianozm24/32/27376_2.png) [@emilianozm24](https://root-forum.cern.ch/u/emilianozm24)\
**Post date:** [September 13, 2021, 8:07pm UTC](https://root-forum.cern.ch/t/tmath-h-is-not-found/46819/1 "2021-09-13T20:07:14Z")

</div>

Hello everyone,

everytime I try to use TMath or TGraph by “include\<TMath.h\>” the compiler can’t find this package:

```auto
ezaldivar@xxxx:~$ g++ -o tarea4 ./tarea4_1.C
./tarea4_1.C:1:10: fatal error: TMath.h: No such file or directory
    1 | #include <TMath.h>
      | ^ ~~~~~~~~
compilation terminated.

```

I am running root 6.14/02 on a ubuntu 20.04.2 on WSL, and I had a lot of trouble with the installation. I wonder if there lies the problem.

Cheers,  
Emiliano.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [September 13, 2021, 8:28pm UTC](https://root-forum.cern.ch/t/tmath-h-is-not-found/46819/2 "2021-09-13T20:28:35Z")

</div>

```bash
`root-config --cxx --cflags` -o tarea4 tarea4_1.C `root-config --libs`

```

---

<div class="post-metadata">

**Author:** ![emilianozm24](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/emilianozm24/32/27376_2.png) [@emilianozm24](https://root-forum.cern.ch/u/emilianozm24)\
**Post date:** [September 21, 2021, 3:33am UTC](https://root-forum.cern.ch/t/tmath-h-is-not-found/46819/3 "2021-09-21T03:33:47Z")

</div>

hello! could you elaborate on that please? I ran the commands as they are and following appeared:

```auto
./tarea4_1.C: In function ‘void tarea4_1()’:
./tarea4_1.C:8:1: error: ‘TFile’ was not declared in this scope
    8 | TFile *file = TFile::Open("$PATH/tdscaler_run009776_00692.root");
      | ^ ~~~~./tarea4_1.C:8:8: error: ‘file’ was not declared in this scope
    8 | TFile *file = TFile::Open("$PATH/tdscaler_run009776_00692.root");
      | ^~~~./tarea4_1.C:8:15: error: ‘TFile’ is not a class, namespace, or enumeration
    8 | TFile *file = TFile::Open("$PATH/tdscaler_run009776_00692.root");
      | ^ ~~~~./tarea4_1.C:9:1: error: ‘TTree’ was not declared in this scope
    9 | TTree *arbol = (TTree*) file->Get("XCDF");
      | ^ ~~~~./tarea4_1.C:9:8: error: ‘arbol’ was not declared in this scope
    9 | TTree *arbol = (TTree*) file->Get("XCDF");
      | ^ ~~~~./tarea4_1.C:9:23: error: expected primary-expression before ‘)’ token
    9 | TTree *arbol = (TTree*) file->Get("XCDF");

```

The program I’m trying to run looks like this:

```auto
#include <TMath.h>
#include <iostream>

using namespace std;

void tarea4_1()
{
TFile *file = TFile::Open("$PATH/tdscaler_run009776_00692.root");
TTree *arbol = (TTree*) file->Get("XCDF");
Int_t entradas = arbol->GetEntries();

Int_t Canales = 1200;
UInt_t channelIDInfo[Canales];
arbol->SetBranchAddress("scaler.channelID", channelIDInfo);

cout << "looping..." << endl;

for(Int_t i=0; i<entradas; i++)
  {
    arbol->GetEntry(i);
  }
}

```

I see TMath.h is present on `~rootbuild/include`, but I wouldn’t know how to tell the compiler that it is there. Very appreciated anyways.

Cheers,  
Emiliano.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [September 21, 2021, 5:01am UTC](https://root-forum.cern.ch/t/tmath-h-is-not-found/46819/4 "2021-09-21T05:01:52Z")

</div>

Obviously, missing :

```cpp
#include "TFile.h"
#include "TTree.h"

```
