Embed rootcling in a compiled C++ program


In this post I learned how to embed stand-alone cling to a compiled C++ program.

I want to do something similar, but I don’t want to introduce another dependency (stand-alone cling), if possible.

I browsed the headers installed on my computer:

root /etc/root/cling/
root /etc/root/cling/Interpreter/
root /etc/root/cling/Interpreter/DynamicExprInfo.h
root /etc/root/cling/Interpreter/DynamicLookupLifetimeHandler.h
root /etc/root/cling/Interpreter/DynamicLookupRuntimeUniverse.h
root /etc/root/cling/Interpreter/Exception.h
root /etc/root/cling/Interpreter/RuntimePrintValue.h
root /etc/root/cling/Interpreter/RuntimeUniverse.h
root /etc/root/cling/Interpreter/Value.h

And some of the required headers, such cling/Utils/Casting.h seems to be missing.

So, can just use the header files provided by a ROOT binary distribution and embed rootcling or cling to a compiled C++ program, without any additional dependencies?

@vvassilev might know better if this is possible

Unfortunately no. You do not get the cling binary as part of the root distribution due to the different setup we use to build ROOT’s libCling. rootcling is a tool which produces dictionaries and has a very little to do with cling standalone.

The way you can embed cling is described briefly here: https://rawgit.com/vgvassilev/cling/master/www/index.html

IIRC … In the good old days, when @brun ruled this world, the “cint” executable was also automatically built together with “root”. Why not return to this good old practice so that now the “cling” executable is provided, too?

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