No dictionary for std::vector in Root?


I have a root installation, version 5.18. I wanted to add some branches to a TTree of type sd::vector but I could not. The error I encountered is as follows for each branch:

Error in TTree::Branch: The class requested (vector) for the branch "pdgId"refer to an stl collection and do not have a compiled CollectionProxy. Please generate the dictionary for this class (vector)

I could compile my code on a different installation and I would like to know what could be wrong with my copy of root that I get this error.

Further, getting to know how to solve the problem will also be appreciated.

Thanks and with regards,



simply call gROOT->ProcessLine("#include "); before creating the branch.

Cheers, Axel.

Hi Axel,

Thanks! It works.
Can you please clarify a bit more as to why this is required. (As I said, my code ran merrily on a different ROOT installation, without this fix).

Best regards,


gROOT->ProcessLine("#include "); makes sure that the pre-compiled dictionary for some of the vector instance is properly loaded.
In much older version of ROOT, this call used to be done by default at startup time. However in order to reduce the memory size for application that are not using any vector, ROOT no longer load this by default.