Vector<vector<double> > in compiled code

I’m attempting to access a variable of the form vector<vector > from a tree using compiled root code (v5.24). Whenever I attempt this I get the message the same as here:

root.cern.ch/phpBB2/viewtopic.php?t=4936

The code runs and gives output that looks sensible, but I’ve no way of knowing if it is actually correct, so I’d like to fix the problem. I gather that I need to define a dictionary for this object, but it is unclear from the various posts I’ve read how exactly this is done for compiled code (vs running CINT). I’ve played around with this for awhile, with no success, but I imagine this must be something that is done often what with all the vector<vector > that are running about.

Adding lines to header files as in

root.cern.ch/phpBB2/viewtopic.php?t=2061

like this:

#include
#ifdef MAKECINT
#pragma link C++ class std::vector<std::vector >+;
#endif

doesn’t make the error message go away.

Hi,

You need to call rootcint, compile the result and link it into your library/executable. See the User’s Guide chapter on generating a dictionary for more details.

Alternatively you can use ACLiC to execute all those steps for you. If you call the file containing the code your listed ‘loader.C’ just add to your code:gROOT->ProcessLine(".L loader.C+");

Cheers,
Philippe.

Thanks, Philippe. This latter worked once I got the path right in the ProcessLine so I could have the Loader.C file in my package rather than in the macros directory in the root installation.