# How to use libCling.so in other c++ project

**URL:** <https://root-forum.cern.ch/t/how-to-use-libcling-so-in-other-c-project/62645>\
**Category:** Newbie\
**Tags:** cling\
**Created:** [January 13, 2025, 4:07am UTC](https://root-forum.cern.ch/t/how-to-use-libcling-so-in-other-c-project/62645 "2025-01-13T04:07:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerryjin](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@jerryjin](https://root-forum.cern.ch/u/jerryjin)\
**Post date:** [January 13, 2025, 4:07am UTC](https://root-forum.cern.ch/t/how-to-use-libcling-so-in-other-c-project/62645/1 "2025-01-13T04:07:35Z")

</div>

* * *

_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

\_ROOT Version: v6-34-02@v6-34-02  
\_Platform: ubuntu 24.04  
\_Compiler: gcc

* * *

Hello, I’m new to ROOT, I just used the root-docker for a few weeks. I found there’s a `/opt/root/lib/libCling.so` file, it looks like the c++ interpreter engine.

I’m wondering if it’s possible to use it in other c++ project, like linking to `libCling.so` and interpreting c++ source code, thanks!

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [January 13, 2025, 9:27am UTC](https://root-forum.cern.ch/t/how-to-use-libcling-so-in-other-c-project/62645/2 "2025-01-13T09:27:06Z")

</div>

Welcome to the ROOT Forum!  
I guess so, in principle. But I think @hahnjo knows better if it’s straight forward

---

<div class="post-metadata">

**Author:** ![hahnjo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hahnjo/32/34077_2.png) [@hahnjo](https://root-forum.cern.ch/u/hahnjo)\
**Post date:** [January 13, 2025, 9:43am UTC](https://root-forum.cern.ch/t/how-to-use-libcling-so-in-other-c-project/62645/3 "2025-01-13T09:43:43Z")

</div>

Hi @jerryjin, yes in principle you can just link against `libCling.so` from a ROOT installation. You can also build Cling standalone, outside of ROOT, in case this is more convenient. Depending on your needs, there’s also the “upstream version” of Cling called Clang-Repl. You will get it with any recent installation of LLVM and Clang, and it’s already quite capable, so maybe that already addresses your needs.

---

<div class="post-metadata">

**Author:** ![jerryjin](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@jerryjin](https://root-forum.cern.ch/u/jerryjin)\
**Post date:** [January 14, 2025, 2:37am UTC](https://root-forum.cern.ch/t/how-to-use-libcling-so-in-other-c-project/62645/4 "2025-01-14T02:37:41Z")

</div>

thank you @hahnjo and @bellenot
