Hi,
I’ve got some code that works fine under 5.27, and I need to see if it (or something similar) can work back in 5.22. Basically, I’m trying to make a vector<vector> (or float) written out as a branch. I use ACLIC to compile my .C file, and it contains early in the file the following:
#ifdef __MAKECINT__
#pragma link C++ class vector<vector<float> >+;
#pragma link C++ class vector<vector<double> >+;
#endif
The code that declares the Branch looks like the following:
TTree *t = new TTree ("testTree", "Test of the tree");
vector<vector<float> > info = vector<vector<float> >();
vector<vector<float> > *pinfo = &info;
t->Branch("info", &pinfo);
When I run on Windows in 5.27 this works just fine - no errors (I don’t need the vector<vector> dict generation either, actually). However, when I’m running on Linux (lxplus), using root 5.22, I get some errors:
[code][lxplus308] root -b -q ROOTTest.cxx+
-
*
-
W E L C O M E to R O O T *
-
*
- Version 5.22/00j 23 April 2010 *
-
*
- You are welcome to visit our Web site *
-
http://root.cern.ch *
-
*
ROOT 5.22/00j (branches/v5-22-00-patches@33102, May 03 2010, 18:59:00 on linux)
CINT/ROOT C/C++ Interpreter version 5.16.29, Jan 08, 2008
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0]
Processing ROOTTest.cxx+…
Info in TUnixSystem::ACLiC: creating shared library /afs/cern.ch/user/g/gwatts/testdir/15.6.10.4/./ROOTTest_cxx.so
Note: Link requested for undefined class vector<vector > (ignore this message) :0:
Note: Link requested for undefined class vector<vector > (ignore this message) :0:
Error: A dictionary has been requested for vector<vector > but there is no declaration!
Error: A dictionary has been requested for vector<vector > but there is no declaration!
Error in TTree::Branch: The pointer specified for info is not of a class known to ROOT
Test 5 (2D vector of vector, variable size): 0.4 (rt:0.405116) - count 1807188
Error in TTree::Branch: The pointer specified for info is not of a class known to ROOT
Test 6 (2D vector of vector of float, variable size): 0.3 (rt:0.30529) - count 1806304
[/code]
So there are errors duing what I assume is the build part of the process (the not declared bits) and then there are the real errors - unknonw class errors.
What do I need to do to get this to work under 5.22? I’ve seen other references to this working post 5.20, but I can’t seem to get it right (I’ve tried ProcessLine("#include ") for example, but it doesn’t seem to change anything).
Thanks in advance!