문제

For a school project my team and I are working on a project in which we are required to use the cling interpreter. We watched several youtube videos about cling and all got it compiled and working on our systems.

The problem we are facing is that we can't seem to find out how we can call cling functions from within our c++ code. There is almost no information available on this topic (or atleast we can't find it). We already checked the cern-website about this subject and the support forums.

Does anyone has a good example or a website where we can find more information on this topic?

Thanks in advance.

With kind regards,
Bob

Update:
We found out that by including cling/Interpreter/Interpreter.h we could talk to the interpreter. We haven't got it compiling yet but we are getting closer. For more info, check: http://www.youtube.com/watch?v=wZZdDhf2wDw

도움이 되었습니까?

해결책

Sorry for the late answer. If you want to embed the interpreter in your program, you will have to link against libCling or you should build so. On the prompt, you can do:

#include "cling/Interpreter/Interpreter.h"

Then on the prompt you could use the gCling variable which is a reference to the interpreter itself. For example:

gCling->process("somecodehere")

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top