# Problem with library MathCore linker

**URL:** <https://root-forum.cern.ch/t/problem-with-library-mathcore-linker/36631>\
**Category:** ROOT\
**Created:** [November 1, 2019, 8:08pm UTC](https://root-forum.cern.ch/t/problem-with-library-mathcore-linker/36631 "2019-11-01T20:08:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicola\_Rizzi](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nicola_rizzi/32/18416_2.png) [@Nicola\_Rizzi](https://root-forum.cern.ch/u/Nicola_Rizzi)\
**Post date:** [November 1, 2019, 8:08pm UTC](https://root-forum.cern.ch/t/problem-with-library-mathcore-linker/36631/1 "2019-11-01T20:08:12Z")

</div>

* * *

_ROOT Version:_ 6.18.02  
_Platform:_ Elementary (Ubuntu 16.04)  
_Compiler:_ g++ 5.5.0 20171010

* * *

Hi everybody,

I’m having a little problem with a fresh new ROOT installation. I tried to run an old code that worked perfectly on an old laptop (cannot remember ROOT version). The code was compiled using g++ compiler with the following bash script:

```auto
#! /bin/bash

g++ -o accident macro.cpp `root-config --cflags --libs` source/Source.cpp source/Utility.cpp source/Transport.cpp source/Output.cpp source/OuterSource.cpp source/Dispersion.cpp source/Dose.cpp
./accident

```

the source/name.cpp are self-written libraries. The problem I have running this script is:

```auto
/usr/bin/ld: /tmp/cc0bU8xm.o: undefined reference to symbol '_ZN5TMath4GausEdddb'
/home/nicola/Downloads/root-6.18.02-build/lib/libMathCore.so: error adding symbols: DSO missing from command line

```

while I was looking for a solution i realized is a linker problem to the MathCore library. But when I run the command root-config --libs :

```auto
-L/home/nicola/Downloads/root-6.18.02-build/lib -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lROOTVecOps -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lROOTDataFrame -pthread -lm -ldl -rdynamic

```

I can see the command -lMathCore, so I have no idea of what to do.

In any case I attach the macro.cpp file  
[macro.cpp](https://root-forum.cern.ch/uploads/short-url/7rTSWJkILCiAuwTsCBl1EsvgvNZ.cpp) (850 Bytes)

Any kind of help is appreciated

---

<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:** [November 1, 2019, 8:38pm UTC](https://root-forum.cern.ch/t/problem-with-library-mathcore-linker/36631/2 "2019-11-01T20:38:06Z")

</div>

Try:

```auto
`root-config --cxx --cflags` -o accident macro.cpp source/Source.cpp source/Utility.cpp source/Transport.cpp source/Output.cpp source/OuterSource.cpp source/Dispersion.cpp source/Dose.cpp `root-config --libs`

```

---

<div class="post-metadata">

**Author:** ![Nicola\_Rizzi](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nicola_rizzi/32/18416_2.png) [@Nicola\_Rizzi](https://root-forum.cern.ch/u/Nicola_Rizzi)\
**Post date:** [November 1, 2019, 9:11pm UTC](https://root-forum.cern.ch/t/problem-with-library-mathcore-linker/36631/4 "2019-11-01T21:11:37Z")

</div>

It works perfectly. But how, without calling the g++ compiler?

Thank you so much

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [November 15, 2019, 9:11pm UTC](https://root-forum.cern.ch/t/problem-with-library-mathcore-linker/36631/5 "2019-11-15T21:11:41Z")

</div>

Closed on November 15, 2019, 9:11pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
