Is there a way to create a library with cling script and load it into a c++ code.
Something like a function declared in cling (library named libfuncA.so)
.rawInput
void funcA(void *b){
int &a = *(int*)b;
a=220;
}
Make this into a library and load it into c++ code to execute the function from the library.
int main(int argc, const char* const* argv){
cling::Interpreter interpreter(argc,argv, LLVMDIR);
//Load Library and call funcA() from the script. How to?
}
Thanks Alex. Yes, I went through the demo and the “plutification” example works fine.
Although, there is a part of the design where we need to use functions written by others(custamization like). We are currently using Lua bindings for it and trying to move to cling instead. Would a LoadFile() that has the function definitions work in this scenario? If, so, after loading the file, will the functions be accessible with function pointers?