# Error trying to use functions from Mathmore

**URL:** <https://root-forum.cern.ch/t/error-trying-to-use-functions-from-mathmore/45099>\
**Category:** Newbie\
**Created:** [May 26, 2021, 10:11pm UTC](https://root-forum.cern.ch/t/error-trying-to-use-functions-from-mathmore/45099 "2021-05-26T22:11:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpitta](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rpitta](https://root-forum.cern.ch/u/rpitta)\
**Post date:** [May 26, 2021, 10:11pm UTC](https://root-forum.cern.ch/t/error-trying-to-use-functions-from-mathmore/45099/1 "2021-05-26T22:11:56Z")

</div>

I’m getting the following error when I try to run a root macro in bash terminal (root -l -b mymacro.C) or when a load the macro manually in root.:

> IncrementalExecutor::executeFunction: symbol ‘\_ZN4ROOT4Math6expintEd’ unresolved while linking [cling interface function]!  
> You are probably missing the definition of ROOT::Math::expint(double)  
> Maybe you need to load the corresponding shared library?

I’ve included the following headers:

```auto
#include "TMinuit.h"
#include "TMath.h"
#include "TFile.h"
#include "TH1F.h"
#include "TF1.h"
#include "TTree.h"
#include "TRandom.h"
#include "gsl/gsl_sf_expint.h"

```

The problem seems to be due to this custom function I’m defining before the void myfunc():

```auto
Double_t Energy_int(Double_t emin, Double_t emax, Double_t element, Double_t m_a){
	Double_t rvt;
	Double_t xmin = x_n(element, emin, m_a);
	Double_t xmax = x_n(element, emax, m_a);

	if(emin > emax){rvt = 0;}
	else{
	rvt = (TMath::Exp(-xmax)/xmax + ROOT::Math::expint(-xmax)) - (TMath::Exp(-xmin)/xmin + ROOT::Math::expint(-xmin));

	}
	return rvt;

}

```

I can use the exponential integral function if I prompt gSystem-\>Load(“libMathMore”) in root before loading the macro. When I do it, the macro doesn’t have any errors.

Is there any way I can run the macro directly from bash or compile it only once without the need to prompt gSystem-\>Load(“libMathMore”)?

Thank you in advance

\_ROOT Version: 6.04/14  
\_Platform:linuxx8664gcc

* * *

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [May 27, 2021, 10:38am UTC](https://root-forum.cern.ch/t/error-trying-to-use-functions-from-mathmore/45099/2 "2021-05-27T10:38:39Z")

</div>

After the `#include`s, add `R__LOAD_LIBRARY(MathMore)` - that should solve it!

---

<div class="post-metadata">

**Author:** ![rpitta](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rpitta](https://root-forum.cern.ch/u/rpitta)\
**Post date:** [May 27, 2021, 6:24pm UTC](https://root-forum.cern.ch/t/error-trying-to-use-functions-from-mathmore/45099/3 "2021-05-27T18:24:38Z")

</div>

> [@Axel](#):
>
> `R__LOAD_LIBRARY(MathMore)`

Thank you!
