# Embedded Cling partially working

**URL:** <https://root-forum.cern.ch/t/embedded-cling-partially-working/64999>\
**Category:** Newbie\
**Tags:** cling\
**Created:** [September 23, 2026, 3:22am UTC](https://root-forum.cern.ch/t/embedded-cling-partially-working/64999 "2026-09-23T03:22:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![frost\_nova](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/f/53a042/32.png) [@frost\_nova](https://root-forum.cern.ch/u/frost_nova)\
**Post date:** [September 23, 2026, 3:22am UTC](https://root-forum.cern.ch/t/embedded-cling-partially-working/64999/1 "2026-09-23T03:22:24Z")

</div>

* * *

Hi, I’ve been interested on using ROOT Cling as part of a project that reads external `*.cpp` files to expand itself, however I ran into multiple hurdles trying to properly setup a working demo.

my current setup consist of the standalone build of Cling alongside the LLVM/Clang used to build against, I went with this options due to some issues I had with the Cling+LLVM build with missing install files. I managed to reach a point where Cling partially works but fails at finding `RuntimeUniverse.h` and breaks when trying to include libraries.

I tried bashing my head onto it alongside using help from Claude to no avail, so I welcome any help possible 🙂.

below is my current `CmakeLists.txt` :

```auto
project(cling_test C CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(LLVM_NO_DEAD_STRIP 1)

add_executable(cling_test main.cpp)

set(Cling_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party/cling-install/lib/cmake/cling/")
set(LLVM_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party/llvm-install/lib/cmake/llvm/")
set(Clang_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party/llvm-install/lib/cmake/clang/")

find_package(LLVM REQUIRED)
find_package(Clang REQUIRED)
find_package(Cling REQUIRED)

target_include_directories(cling_test PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/third-party/cling-install/include/"
"${CMAKE_CURRENT_SOURCE_DIR}/third-party/llvm-install/include/"
)
target_link_libraries(cling_test "${CMAKE_CURRENT_SOURCE_DIR}/third-party/cling-build/lib/libcling.so")

target_compile_options(cling_test PUBLIC -DLLVMDIR="${CMAKE_CURRENT_SOURCE_DIR}/third-party/llvm-install" -I$${CMAKE_CURRENT_SOURCE_DIR}/third-party/llvm-install/include -I$${CMAKE_CURRENT_SOURCE_DIR}/third-party/cling-install/include)
target_compile_options(cling_test PRIVATE -fno-rtti)
set_target_properties(cling_test PROPERTIES ENABLE_EXPORTS 1)

```

_ROOT Version:_ 6.40.04  
_Platform:_ Arch  
_Compiler:_ gcc

* * *

---

<div class="post-metadata">

**Author:** ![ajomy](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ajomy/32/37349_2.png) [@ajomy](https://root-forum.cern.ch/u/ajomy)\
**Post date:** [September 28, 2026, 9:40am UTC](https://root-forum.cern.ch/t/embedded-cling-partially-working/64999/2 "2026-09-28T09:40:06Z")

</div>

Welcome to the ROOT forum!

Can you try adding the Cling include paths (I assume here is `${CMAKE_CURRENT_SOURCE_DIR}/third-party/cling-install/include/"`) to the interpreter? You can pass it your instance of `cling::Interpreter` by calling `AddIncludePath`.

Best,  
Aaron
