How to generate vector<"heder file">. please help me out

___ Here I’m attaching the Error showing in terminal during running my root macro. I already made a header file name "MyEvent.h" . and used this header file to my root macro. But it shows this error plase help me how to get rid off this error.

ERROR-

Error in <TTree::Branch>: The class requested (vector<MyEvent>) for the branch "Events" is an instance of an stl collection and does not have a compiled CollectionProxy. Please generate the dictionary for this collection (vector<MyEvent>) to avoid to write corrupted data.

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


You need to generate a dictionary, probably the simple example you could check here [1]

@pcanal do you have a simple example (e.g. maybe some modern example how to generate dictionary on the web page with explanation) to help here? Thank you in advance!

[1] https://root.cern.ch/how/how-create-dictionary

In the end of your “MyEvent.h” file, try to add:

#include <vector>
#if defined(__MAKECINT__) || defined(__ROOTCLING__)
#pragma link C++ class MyEvent+;
#pragma link C++ class std::vector<MyEvent>+;
#endif

Then try:

root [0] .L MyEvent.h++

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.