Hi all,
I have found some posts in the forum dealing with CINT dictionaries & STL object, but I still have the following problem: using this test example:
File Calib.h :
#include <stdio.h>
#include <TNamed.h>
#include <vector>
using namespace std;
class Calib: public TNamed{
public:
Calib(){};
vector<Calib*> calibs;
ClassDef(Calib,1);
};
#if defined __MAKECINT__ || defined __CINT__
#pragma link C++ class vector<Calib*>+;
#endif
File Calib.cxx:
#include "Calib.h"
ClassImp(Calib);
I am trying to have it working with its dictionaries: using directly the root prompt it works (in 5.22 but not in 5.17 but it’s fine):
.L Calib.cxx++
Calib c
printf("%d\n", c.calibs.size());
(int)0
everything works (NOTE: it seems that the #pragma is needed)
When i try with a makefile it doesn’t seem to work:
g++ -pthread -m32 -I/usr/local/root/include -I. -Wall -O3 Calib.cxx -c -o Calib.o
rootcint -f Calib.CintDictionary.cxx -c -pthread -m32 -I/usr/local/root/include -I. -Wall -O3 Calib.h
g++ -pthread -m32 -I/usr/local/root/include -I. -Wall -O3 Calib.CintDictionary.cxx -c -o Calib.CintDictionary.o
g++ -shared Calib.o Calib.CintDictionary.o -o Calib.so
root
.L Calib.so
Calib c
printf("%d\n", c.calibs.size());
Error: Can't call vector<Calib*,allocator<Calib*> >::size() in current scope (tmpfile):1:
Possible candidates are...
(in vector<Calib*,allocator<Calib*> >)
do you have any clue?
thank you!
Luigi
(using ROOT 5.22/00 (trunk@26997, Jan 20 2009, 14:20:00 on linux)