Using cling inside C ++, how to do this?

In the school project, my team and I are working on a project in which we must use the cling interpreter . We watched several YouTube videos on how to cling, and they are all assembled and working on our systems.

The problem we are facing is that we cannot understand how we can call the cling functions from our C ++ code. There is almost no information on this topic (or at least we cannot find it). We have already checked the cern website on this subject and support forums.

Does anyone have a good example or website on which we can find further information on this topic?

Thanks in advance.

Yours faithfully,
Bean

Update:
We found that by turning on cling/Interpreter/Interpreter.h , we could speak with a translator. We do not have compilation yet, but we are getting closer. For more information check: http://www.youtube.com/watch?v=wZZdDhf2wDw

+4
source share
1 answer

Sorry for the late reply. If you want to embed the interpreter in your program, you will need to set the link to libCling , or you must do this. At the command line, you can:

 #include "cling/Interpreter/Interpreter.h" 

Then, at the prompt, you can use the gCling variable, which is a reference to the interpreter itself. For instance:

 gCling->process("somecodehere") 

A good start to learning about hooking is its test suite and doxygen documentation. The mailing list cling-dev@cern.ch also a good idea.

+7
source

Source: https://habr.com/ru/post/1484418/


All Articles