# How to include Math::Interpolator?

**URL:** <https://root-forum.cern.ch/t/how-to-include-math-interpolator/44313>\
**Category:** Newbie\
**Tags:** math\
**Created:** [April 7, 2021, 2:09pm UTC](https://root-forum.cern.ch/t/how-to-include-math-interpolator/44313 "2021-04-07T14:09:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbiel](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/e56c9b/32.png) [@pbiel](https://root-forum.cern.ch/u/pbiel)\
**Post date:** [April 7, 2021, 2:09pm UTC](https://root-forum.cern.ch/t/how-to-include-math-interpolator/44313/1 "2021-04-07T14:09:40Z")

</div>

Hi fellow ROOT users!

I think I have an issue finding the correct Header file. Here’s what I’m trying to use:

```c++
#include <iostream>
#include "TMath.h"
#include "Math/Interpolator.h"

void interpolate()
{
	std::vector<double> vec_a {0., 3., 16.};
	std::vector<double> vec_b {1., 9., 24.};
	
	Math::Interpolator* my_interpolator = new Math::Interpolator(vec_a, vec_b, ROOT::Math::Interpolation::kLINEAR);
	
	std::cout << "5 -> " << my_interpolator->Eval(5) << std::endl;
}

```

When trying to compile, i.e. `root [0] .L interpolate.C+`, I receive the error message

```auto
In file included from input_line_12:9:
././interpolate.C:10:2: error: use of undeclared identifier 'Math'
        Math::Interpolator* my_interpolator = new Math::Interpolator(vec_a, vec_b, ROOT::Math::Interpolation::kLINEAR);
        ^
././interpolate.C:10:44: error: use of undeclared identifier 'Math'
        Math::Interpolator* my_interpolator = new Math::Interpolator(vec_a, vec_b, ROOT::Math::Interpolation::kLINEAR);
                                                  ^
Error in <ACLiC>: Dictionary generation failed!

```

My understanding was that [Math::Interpolator](https://root.cern.ch/root/html534/ROOT __Math__ Interpolator.html) is defined in [“Math/Interpolator.h”](https://root.cern.ch/root/html534/src/ROOT __Math__ Interpolator.h.html), which I include. But apparently, I miss something here …

BTW: Is there a general rule to find out which headers are required in ROOT?

* * *

_ROOT Version:_ 5.34 and 6.16  
_Platform:_ GNU/Linux

* * *

---

<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:** [April 7, 2021, 2:37pm UTC](https://root-forum.cern.ch/t/how-to-include-math-interpolator/44313/2 "2021-04-07T14:37:57Z")

</div>

`ROOT::Math::Interpolator`
