IncrementalExecutor::executeFunction ... unresolved while linking function'_Z15__cling_Un1Qu30Pv'!

I’m using a class (made with TTree->MakeClass(…)) in a macro which processes a file to produce plots. However when I run the macro (using the command root -l -q -b it displays the following :

IncrementalExecutor::executeFunction: symbol ‘_ZN13AnalysisClassC1EP5TTree’ unresolved while linking function’_Z15__cling_Un1Qu30Pv’!

After googling around I’ve only seen this issue mentioned for MAC - and people suggested upgrading to 6.02/12 (this is the version I am already using), but the machine I’m running on is Scientific Linux release 6.7.

Any ideas for what is causing the problem? (Is this a bug, or am I doing something incorrectly?) Thanks!


can you share a reproducer?


Sure thing!

I’ve attached a small macro that throws this error for me as well as a small ntuple (as small as I can make it) to run on. I use the command root -l -q -b to run the code. The class I made with ttree->makeClass(…) is also attached. (1.81 KB)
AnalysisClass.C (1.44 KB)
AnalysisClass.h (47.3 KB)
test-hist.root (150 KB)


thanks for the code. In this setup the symbols of Analysis class are not available: it is not enough to include the header in the macro (it would not be enough here even using a compiler, it’s not specific to ROOT interpretation of the macro).
To solve the issue, there are several ways, the simplest being:

root[0] .L AnalysisClass.C+
root[1] .x 

Before proceeding though you have to undefine the preprocessor macro AnalysisClass_cxx with

#undef AnalysisClass_cxx

at the end of AnalysisClass.C. Said that, it is in general good practice to keep definitions and implementations separated without introducing additional preprocessor macros to intervene in the compilation of files.

I cannot see the program running as a file


is not accessible for me (of course). I assume the item is solved. Let me know if this is not the case.


Thanks for this reponse - it does indeed work (FYI I attached a .root file for you to test on called “test-hist.root”, you don’t need to access the /export/…blahblah file, as both are produced by exactly the same analysis code).

I really don’t understand a lot of what you’re saying (sorry, not a programming wiz) but is there some reason why the “#undef” line isn’t automatically added to the makeClass(…)? I added it, but if I use makeClass(…) in the future I will just have to remember to do that every time?

Finally, I will be running this macro many times over with a bash script and so I need a root command friendly to that end. Rather than the root CINT command could you suggest a single line statement? Thanks!


in case you want to run the code many times I suggest to compile it in a single executable which takes command line arguments/is configured with a configuration file.


I’ve now got a problem using other bits of my code (that I removed to isolate this error).

My macro was used to make plots by creating a TCanvas and the print(…) command. Since adding this bit to my macro spits out

“Error in TInterpreter::TCling::AutoLoad: failure loading library for TGQt
cling::DynamicLibraryManager::loadLibrary(): cannot open shared object file: No such file or directory”

I’ve attached the “updated” simple code I’m using - the only change is that this attempts to make the plot and save to file. This means of saving the plots to file has worked for me a lot in the past - I don’t understand why the new commands cause it to break. (Also it is a bit annoying that it opens up all of the plots and I have to click the (x) on each one…is there a command to suppress the display?) Thanks! (2.13 KB)


for running in batch mode, TROOT::SetBatch: … e48866be8d

As for the error you are seeing, it seems that the library is nowhere to be found. What is the output of “ldd”?
Also, do you know at what point in the execution this error is happening? Do you have a reproducer?