# Missing Minuit2 Libraries

**URL:** <https://root-forum.cern.ch/t/missing-minuit2-libraries/45786>\
**Category:** Newbie\
**Created:** [July 10, 2021, 2:19pm UTC](https://root-forum.cern.ch/t/missing-minuit2-libraries/45786 "2021-07-10T14:19:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![christianwos83](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/eb8c5e/32.png) [@christianwos83](https://root-forum.cern.ch/u/christianwos83)\
**Post date:** [July 10, 2021, 2:19pm UTC](https://root-forum.cern.ch/t/missing-minuit2-libraries/45786/1 "2021-07-10T14:19:32Z")

</div>

Hello,

I am trying to run Minuit2 on my other computer. I installed root 6.22.00. I have a program called niminimzation.cpp and I try to compile it by running

```auto
g++ -I/home/christian/root/include -L/home/christian/root/lib niminimzationExample.cpp -o niminimzationExample -lMinuit2

```

but when I do I get the following error

```auto
/usr/bin/ld: warning: libHist.so.6.22, needed by /home/christian/root/lib/libMinuit2.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libMathCore.so.6.22, needed by /home/christian/root/lib/libMinuit2.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libCore.so.6.22, needed by /home/christian/root/lib/libMinuit2.so, not found (try using -rpath or -rpath-link)
/home/christian/root/lib/libMinuit2.so: undefined reference to `TNamed::Compare(TObject const*) const'
/home/christian/root/lib/libMinuit2.so: undefined reference to `ROOT::AddClassAlternate(char const*, char const*)'
/home/christian/root/lib/libMinuit2.so: undefined reference to `TIsAProxy::TIsAProxy(std::type_info const&)'
/home/christian/root/lib/libMinuit2.so: undefined reference to `TObject::DrawClone(char const*) const'
/home/christian/root/lib/libMinuit2.so: undefined reference to `TObject::Browse(TBrowser*)'

```

etc. I know that all of those libraries are in /home/christian/root/lib, so I thought I would add the ones that the error says are missing, by running,

```auto
g++ -I/home/christian/root/include niminimzationExample.cpp -o niminimzationExample -L/home/christian/root/lib -lMinuit2 -lCore -lHist

```

but then I get the following error:

```auto
/usr/bin/ld: warning: libMathCore.so.6.22, needed by /home/christian/root/lib/libMinuit2.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libMatrix.so.6.22, needed by /home/christian/root/lib/libHist.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libRIO.so.6.22, needed by /home/christian/root/lib/libHist.so, not found (try using -rpath or -rpath-link)
/home/christian/root/lib/libHist.so: undefined reference to `TMath::CauchyDist(double, double, double)'
/home/christian/root/lib/libHist.so: undefined reference to `ROOT::Math::GaussIntegrator::IntegralUp(double)'
/home/christian/root/lib/libHist.so: undefined reference to `TMatrixTColumn_const<double>::TMatrixTColumn_const(TMatrixT<double> const&, int)'
/home/christian/root/lib/libHist.so: undefined reference to `ROOT::Math::RichardsonDerivator::Derivative3(ROOT::Math::IBaseFunctionOneDim const&, double, double)'
/home/christian/root/lib/libHist.so: undefined reference to `TMath::BesselK0(double)'

```

So I am missing other libraries. Is there a way to include all of the necessary libraries at once, without having to go through all of this? On my other computer I have a stand-alone version of Minuit2 nd I can run it simply with

```auto
g++ -I/home/christian/root/include -L/home/christian/root/lib niminimzationExample.cpp -o niminimzationExample -lMinuit2

```

Thanks.  
Christian

\_ROOT Version: 6.22.00  
\_Platform: Linux Mint  
\_Compiler: gcc

* * *

---

<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:** [July 10, 2021, 2:24pm UTC](https://root-forum.cern.ch/t/missing-minuit2-libraries/45786/2 "2021-07-10T14:24:59Z")

</div>

```bash
`root-config --cxx --cflags` -o niminimzationExample niminimzationExample.cpp `root-config --libs` -lMinuit2

```

---

<div class="post-metadata">

**Author:** ![christianwos83](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/eb8c5e/32.png) [@christianwos83](https://root-forum.cern.ch/u/christianwos83)\
**Post date:** [July 10, 2021, 2:27pm UTC](https://root-forum.cern.ch/t/missing-minuit2-libraries/45786/3 "2021-07-10T14:27:33Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> ``root-config --cxx --cflags`-o niminimzationExample niminimzationExample.cpp`root-config --libs` -lMinuit2`

Thank you. But when I run that command it says

```auto
root-config: command not found

```

---

<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:** [July 10, 2021, 2:30pm UTC](https://root-forum.cern.ch/t/missing-minuit2-libraries/45786/4 "2021-07-10T14:30:32Z")

</div>

`source /home/christian/root/bin/thisroot.sh`

---

<div class="post-metadata">

**Author:** ![christianwos83](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/eb8c5e/32.png) [@christianwos83](https://root-forum.cern.ch/u/christianwos83)\
**Post date:** [July 10, 2021, 2:36pm UTC](https://root-forum.cern.ch/t/missing-minuit2-libraries/45786/5 "2021-07-10T14:36:20Z")

</div>

Thanks again. That fixed that part. However, not, after sourcing thisroot.sh I run the other command that you suggested and then

```auto
g++ -I/home/christian/root/include -L/home/christian/root/lib niminimzationExample.cpp -o niminimzationExample -lMinuit2

```

and I get the following error.

```auto
/home/christian/root/lib/libHist.so.6.22: undefined reference to `exp@GLIBC_2.29'
/home/christian/root/lib/libMinuit2.so: undefined reference to `log@GLIBC_2.29'
/home/christian/root/lib/libMinuit2.so: undefined reference to `pow@GLIBC_2.29'
collect2: error: ld returned 1 exit status

```

Is there some library or something that I am missing?

Thanks again.

---

<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:** [July 10, 2021, 2:40pm UTC](https://root-forum.cern.ch/t/missing-minuit2-libraries/45786/6 "2021-07-10T14:40:02Z")

</div>

The “other command” that I “suggested” actually builds your executable (or does it return any errors?).

---

<div class="post-metadata">

**Author:** ![christianwos83](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/eb8c5e/32.png) [@christianwos83](https://root-forum.cern.ch/u/christianwos83)\
**Post date:** [July 10, 2021, 2:48pm UTC](https://root-forum.cern.ch/t/missing-minuit2-libraries/45786/7 "2021-07-10T14:48:37Z")

</div>

It returns the error

```auto
/home/christian/root/lib/libHist.so: undefined reference to `exp@GLIBC_2.29'
/home/christian/root/lib/libMinuit2.so: undefined reference to `log@GLIBC_2.29'
/home/christian/root/lib/libMinuit2.so: undefined reference to `pow@GLIBC_2.29'
collect2: error: ld returned 1 exit status

```

---

<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:** [July 10, 2021, 2:55pm UTC](https://root-forum.cern.ch/t/missing-minuit2-libraries/45786/8 "2021-07-10T14:55:01Z")

</div>

It seems to suggest that your ROOT binary distribution is not compatible with your Operating System.  
Are you able to run “`root`”?  
You could also try to explicitly say: `... -lMinuit2 -lm`
