Is it possible to use a user defined function, not a class, interactively in cling? I have yet to figure out how to do this. I can compile a dictionary with a function, and I understand I need a rootmap file to inform cling of symbols and shared libraries where they reside. But when I am trying to implement a function in the LinkDef I use the following pragma:
#pragma link C++ function double func(double);
and rootcling does not generate any output the rootmap file. If I do this whole routine but instead define func as a class instead of a function, then there is no problem; the rootmap file contains the proper entries for the class and I can use the class interactively.
Is the only way to use user defined content interactively in cling through classes? Would someone please provide a simple working example of source code and Makefile or commands to make this work?
By the way in ROOT 5.34 rlibmap would not generate output for the function pragma either, but if I manually put an entry in the rootmap file like
Library.func: libfunc.so
CINT would allow me to access the function interactively anyway. Now if I try something similar using ROOT 6 and cling, I can see the function in cling (tab autocompletes the function name on the command line), but will not actually run the function. I get an error.