Error in <TTree::Branch> - Vector issue

Hi George,

I missed the type of the branch as the code was spread between a long-ish header and implementation :frowning:
So, here you can find the steps to create a dictionary, compile it as a shared lib, load it into a program.
a.h

#include <vector>
namespace dummy_a{ // dummy instantiations
  std::vector<std::vector<int> > a1;
}

LinkDef.h

#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class vector<vector<int> >+;
#endif

Commands to create the shared library

rootcint -f aDict.cxx  -c  a.h LinkDef.h
g++ -o libMylib.so aDict.cxx `root-config --cflags --libs` -shared -fPIC

test macro

{
TFile ofile("ofile.root","RECREATE");
gSystem->Load("libMylib.so");
vector<vector<int> > v;
vector<int> a;
a.push_back(1);
a.push_back(2);
v.push_back(a);
ofile.WriteObjectAny(&v, "std::vector<std::vector<int> >", "v");
}

If you are interested in the newest ROOT version, version 6, I can post the same recipe: it is much simpler.

Cheers,
Danilo