# Is it possible to embedded cling in unreal engine

**URL:** <https://root-forum.cern.ch/t/is-it-possible-to-embedded-cling-in-unreal-engine/62210>\
**Category:** Cling\
**Created:** [November 12, 2024, 4:56am UTC](https://root-forum.cern.ch/t/is-it-possible-to-embedded-cling-in-unreal-engine/62210 "2024-11-12T04:56:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evianaive](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/evianaive/32/37905_2.png) [@Evianaive](https://root-forum.cern.ch/u/Evianaive)\
**Post date:** [November 12, 2024, 4:56am UTC](https://root-forum.cern.ch/t/is-it-possible-to-embedded-cling-in-unreal-engine/62210/1 "2024-11-12T04:56:35Z")

</div>

I always look forward to finding a script solution for Unreal Engine development. I think the best approach is to interpret CPP directly, which is why I found cling. However, there is a problem I am not sure about.  
It’s well known that Unreal Engine Editor is mainly used on Windows computers and compiled by MSVC. Should I compile Unreal Engine using Clang if I want to export methods of Unreal Engine to a Cling interpreter? (Most Unreal Engine users use the released binary version, which is compiled by MSVC)

---

<div class="post-metadata">

**Author:** ![StephanH](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@StephanH](https://root-forum.cern.ch/u/StephanH)\
**Post date:** [November 12, 2024, 8:09am UTC](https://root-forum.cern.ch/t/is-it-possible-to-embedded-cling-in-unreal-engine/62210/2 "2024-11-12T08:09:55Z")

</div>

Hello @Evianaive,

let me ping two persons.  
For Windows, I think @bellenot is the best person to ask, and @vvassilev is the cling expert.

---

<div class="post-metadata">

**Author:** ![vvassilev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/v/f0a364/32.png) [@vvassilev](https://root-forum.cern.ch/u/vvassilev)\
**Post date:** [November 12, 2024, 8:25am UTC](https://root-forum.cern.ch/t/is-it-possible-to-embedded-cling-in-unreal-engine/62210/3 "2024-11-12T08:25:43Z")

</div>

Hi @Evianaive,

Thanks for reaching out. It has been forever on my todo list to look into what’s needed to incorporate Cling in the Unreal Engine. I once looked into how to do it but I lacked knowledge about the engine itself.

Cling uses Clang and Clang is binary compatible with MSVC so there should be no problem in working with binary releases. Please reach out to me in private to see if we can move forward in some way…

Best, Vassil

---

<div class="post-metadata">

**Author:** ![Evianaive](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/evianaive/32/37905_2.png) [@Evianaive](https://root-forum.cern.ch/u/Evianaive)\
**Post date:** [November 12, 2024, 4:44pm UTC](https://root-forum.cern.ch/t/is-it-possible-to-embedded-cling-in-unreal-engine/62210/4 "2024-11-12T16:44:12Z")

</div>

Thank you for your recommendation.

---

<div class="post-metadata">

**Author:** ![Evianaive](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/evianaive/32/37905_2.png) [@Evianaive](https://root-forum.cern.ch/u/Evianaive)\
**Post date:** [November 22, 2024, 4:55am UTC](https://root-forum.cern.ch/t/is-it-possible-to-embedded-cling-in-unreal-engine/62210/5 "2024-11-22T04:55:29Z")

</div>

I found two links about how to build Cling and they look different. Which one works on Windows?  
[Cling Build Instructions - ROOT](https://root.cern/cling/cling_build_instructions/)  
[Cling](https://rawgit.com/root-project/cling/master/www/build.html)

---

<div class="post-metadata">

**Author:** ![Evianaive](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/evianaive/32/37905_2.png) [@Evianaive](https://root-forum.cern.ch/u/Evianaive)\
**Post date:** [November 24, 2024, 12:36pm UTC](https://root-forum.cern.ch/t/is-it-possible-to-embedded-cling-in-unreal-engine/62210/6 "2024-11-24T12:36:42Z")

</div>

I have successfully built Cling from source code. But I get an error when I start it.  
 ![image](https://root-forum.cern.ch/uploads/default/original/3X/f/0/f0042816b91ee6d583532495f5a6c4c393b98571.png)

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [November 26, 2024, 4:29pm UTC](https://root-forum.cern.ch/t/is-it-possible-to-embedded-cling-in-unreal-engine/62210/7 "2024-11-26T16:29:19Z")

</div>

Try to build maybe following these instructions:

> <https://github.com/root-project/cling/issues/531#issuecomment-2473930552>
>
> \- \[x\] Checked for duplicates
> \<!--
> Please search in
> \* https://github.com/root-…project/cling/issues
> \* and meta issues - https://github.com/root-project/cling/issues/406 and https://github.com/root-project/cling/issues/407
> for existing reports of your issue.
> 
> If you find one, you are very welcome to add details to the existing report, for instance.
> \--\>
> 
> \### Describe the bug
> \<!--
> A clear and concise description of what the wrong behavior is.
> \--\>
> I followed the instructions but encountered an error. 
> Is there anything else I need to install as a prerequisite?
> 
> \`\`\`
> $./bin/cling '#include \<stdio.h\>' 'printf("Hello World!\\n")'
> \`\`\`
> I got the following error:
> \`\`\`
> $ ./bin/cling '#include \<stdio.h\>' 'printf("Hello World!\\n")'
> ERROR in cling::CIFactory::createCI():
> resource directory /home/xx/cling-build/lib/clang/16 not found!
> In file included from input\_line\_3:1:
> /usr/include/stdio.h:33:10: fatal error: 'stddef.h' file not found
> \#include \<stddef.h\>
> ^ ~~~~~~~~~
> input\_line\_4:2:2: error: use of undeclared identifier 'printf'
> printf("Hello World!\\n")
> \`\`\`
> \### Expected behavior
> \<!--
> A clear and concise description of what you expected to happen.
> \--\>
> it prints "Hello World!"
> 
> \### To Reproduce
> \<!--
> Steps to reproduce the behavior:
> 1. Your code that triggers the issue: at least a part; ideally something we can run ourselves.
> 2. Don't forget to attach the required input files!
> 3. How to run your code and / or build it.
> \--\>
> 
> \### Setup
> \<!--
> 1. Cling version
> 1.1~dev
> 3. Operating system
> CentOS Stream 9
> 4. How you obtained Cling, such as with cpt.py (also mention flags) / you built it yourself.
> Follow\[the instruction\](https://github.com/root-project/cling?tab=readme-ov-file#building-from-source)
> \--\>
> 
> 1. Cling version
> 1.1~dev
> 3. Operating system
> CentOS Stream 9
> 4. How you obtained Cling, such as with cpt.py (also mention flags) / you built it yourself.
> Follow\[the instruction\](https://github.com/root-project/cling?tab=readme-ov-file#building-from-source)
> 
> \### Additional context
> \<!--
> Add any other context about the problem here.
> \--\>

---

<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:** [December 10, 2024, 4:29pm UTC](https://root-forum.cern.ch/t/is-it-possible-to-embedded-cling-in-unreal-engine/62210/8 "2024-12-10T16:29:52Z")

</div>

Closed on December 10, 2024, 4:29pm UTC

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