Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top