Hi all!
I am trying to add a log in my root script-“xxx.C”. I included “easylogging++.h” and initialize it with “INITIALIZE_EASYLOGGINGPP”。
I must compile xxx.C with easylogging++.h, right? if there is a easy way like “root -l xxx.C ??? easylogging++.h”
Thank you very much!
if easylogging++.h is in the same directory as xxx.C, then root -l xxx.C+ should just work even if xxx.C includes easylogging++.h.
Otherwise I would suggest to switch to an actual standard, compiled C++ program (you might need to add some #includes and a main function to xxx.C) so you can pass the correct compilation options, e.g.:
H @eguiraud ,
Yes, the first way is OK. I missed something previously. Thank you very much!
BTW, I was wondering that when we “root -l”, what compiler we are using behind, still gcc?
Thank you!
root macro.C uses ROOT’s C++ interpreter, cling, which is based on clang.
root macro.C+ compiles the macro code using the same compiler ROOT was built with (the one returned by root-config --cxx), then loads and runs the compiled code with cling.