I am defining a vector for my custom type (for example Track) in a root macro but when I push_back a Track object in the vector, CINT complains. e.g.
or vector or vector push_back works fine.
Error: Can't call vectorAlthough, if I use a vector
This usually indicates that some classes dictionary refer and/or use this particular instance of std::vector.To solve the problem, you will need to generate a dictionary for this particular instance. With ROOT v5.27/06 and above this can be done by executing:
gInterpreter->GenerateDictionary("vector<Track>","Track.h;vector");With older version of ROOT ; this can simply be done using ACLiC and a simple loader.C script:
// File loader.C #include
#include #ifdef __MAKECINT__ #pragma link C++ class vector<Track>+; #endif