I have a class (MyClass.cpp) that I want to load and use in a macro (my_macro.C). What is the difference between (a) compiling & loading the class to memory and (b) making a dictionary entry?
in the macro and then simply running
gROOT->ProcessLine(".x my_macro.C+");
Edit: Let me make myself a bit more clear. In (a), I get a MyClass.so file; in (b) I don’t. In (b) the execution of my_macro starts much faster than in (a). I was wondering if that means that the code in (b) is not optimized(?) and/or if it runs slower than in (a).
In your case a), it exposes to CINT all the symbols declared in MyClass.cpp and MyClass.h, my_macro.C (and my_macro.h).
In b), it exposes to CINT ‘only’ the class MyClass, and the symbols in my_macro.C (and my_macro.h).
Also in a) you generate 2 dictionaries and compile/link 2 separate shared library.
In b) you generate only 1 dictionary and compile/link onlu 1 shared library.
So in conclusion b) is faster but possibly do not expose as much to CINT.