# How to call external libraries

**URL:** <https://root-forum.cern.ch/t/how-to-call-external-libraries/10845>\
**Category:** ROOT\
**Created:** [August 27, 2010, 9:20pm UTC](https://root-forum.cern.ch/t/how-to-call-external-libraries/10845 "2010-08-27T21:20:58Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![SeB](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@SeB](https://root-forum.cern.ch/u/SeB)\
**Post date:** [August 27, 2010, 9:20pm UTC](https://root-forum.cern.ch/t/how-to-call-external-libraries/10845/1 "2010-08-27T21:20:58Z")

</div>

Dir sir,

In ROOT command line, you are in an environment which allow you to compile and execute any program which calls any classes of ROOT. Correct ? You just have to add the correct “#include \<classe.h\>” in the beginning of the code. It works because the ROOT environnement “knows” where to find in the system the corresponding ROOT libraries.

Now, my point is how to allow the call to external classes such as that of FASTJET from within ROOT code ? What I have done is :

1. install Fastjet

2. update my system variables so that any program shoud be able to find the libraries :

3. Re-compile ROOT

What I have got :

a) `g++ short-example.cc -o short-example -I/cern/fastjet-2.4.2/../fastjet-install/include -Wl,-rpath,/cern/fastjet-2.4.2/../fastjet-install/lib -lm -L/cern/fastjet-2.4.2/../fastjet-install/lib -lfastjet`  
=\> Working fine

b) `root [2] .L short_example.cc++`  
=\> Not working, with the following log message :

[quote]Undefined symbols:  
“fastjet::ClusterSequence::~ClusterSequence()”, referenced from:  
\_main in short\_example\_cc\_ACLiC\_dict.o  
\_main in short\_example\_cc\_ACLiC\_dict.o  
“fastjet::PseudoJet::PseudoJet(double, double, double, double)”, referenced from:  
\_main in short\_example\_cc\_ACLiC\_dict.o  
\_main in short\_example\_cc\_ACLiC\_dict.o  
(…)  
ld: symbol(s) not found  
collect2: ld returned 1 exit status  
\*\*\* Interpreter error recovered \*\*\*[/quote]

```auto
root [3] .include
```

> [@](#):
>
> include path: -I/usr/local/root/include/root

Any information in how to tell ROOT where are the libraries I want him to be able to use ?

Regards.

---

_[View the full topic](https://root-forum.cern.ch/t/how-to-call-external-libraries/10845)._
