# Self-contained Executable

**URL:** <https://root-forum.cern.ch/t/self-contained-executable/23704>\
**Category:** Cling\
**Created:** [February 8, 2017, 4:24pm UTC](https://root-forum.cern.ch/t/self-contained-executable/23704 "2017-02-08T16:24:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbenne](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/4af34b/32.png) [@kbenne](https://root-forum.cern.ch/u/kbenne)\
**Post date:** [February 8, 2017, 4:24pm UTC](https://root-forum.cern.ch/t/self-contained-executable/23704/1 "2017-02-08T16:24:07Z")

</div>

I have successfully embedded the cling interpreter into a C++ executable, and I would like to say the whole process was pretty smooth. Thanks for good documentation and a smooth build process.

Now I’m just getting greedy and I want to know if it is possible to embed the resource files that are normally referenced by llvmdir. Currently my cling::Interpreter instantiation looks like:

```auto
  std::vector<const char*> args = {"-nostdinc++","-nobuiltininc"};
  cling::Interpreter interpreter(args.size(),args.data(),llvmdir.c_str()); 
```

Provided I give llvmdir the appropriate filesystem path everything works great. What I would rather do is embed the supporting files (or precompiled versions) into the executable. I have found some breadcrumbs on this forum that this has been possible, at least from ROOT, but the current status is unclear to me. The last piece of information I found was this [url][Cannot find my rdict.pcm files](https://root-forum.cern.ch/t/cannot-find-my-rdict-pcm-files/21901/1) post where it looked like maybe this would happen in v6.10 of ROOT, however my interest is specifically only cling.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [February 14, 2017, 2:19pm UTC](https://root-forum.cern.ch/t/self-contained-executable/23704/2 "2017-02-14T14:19:41Z")

</div>

Hi,

We never tried that. If you have a solution I’d be definitely interested to hear it!

Cheers, Axel.
