#include <map>
#ifdef __MAKECINT__
#pragma link C++ class map<string,int>+;
#pragma link C++ class map<string,int>::iterator;
#pragma link C++ class pair<string,int>;
#endif
Now if I run the code I get the following error :
So even if I add the lines to generate the library, why is this error coming?
Could sombody please help me with th eerror ?
I would like to add one more thing :
On one of the lxplus machines it worked with these lines.
But on the other it didn’t.
and I am using :
/afs/cern.ch/cms/sw/slc4_ia32_gcc345/lcg/root/5.22.00a-cms17/
Could anyone please tell me what needs to be done
so as to make this work on other machines as well?
Thanks much for the reply.
I tried that.
This is how my loader.C looks like :
#include <map>
#ifdef __MAKECINT__
#pragma link C++ class map<string,int>;
#pragma link C++ class map<string,int>::iterator;
#pragma link C++ class pair<string,int>;
#endif
I did :
but I get the following error :
Info in <TUnixSystem::ACLiC>: creating shared library /afs/cern.ch/user/s/shilpi/private/compile_files/cmssw314/treeBasedFiles/./loader_C.so
Note: Link requested for already precompiled class map<string,int,less<string>,allocator<pair<const string,int> > > (ignore this message) :0:
Note: Link requested for undefined class pair<string,int> (ignore this message) :0:
Note: Link requested for already precompiled class map<string,int,less<string>,allocator<pair<const string,int> > >::iterator (ignore this message) :0:
Error in <ACLiC>: Dictionary generation failed!
Info in <ACLiC>: Invoking compiler to check macro's validity
Info in <ACLiC>: The compiler has not found any problem with your macro.
Probably your macro uses something rootcint can't parse.
Check http://root.cern.ch/root/Cint.phtml?limitations for Cint's limitations.
Could you please tell me what is it that I missing?
However map<string,int> is one of the container for which we provide a dictionary so just need to make sure that the interpreter see #include before passing a map to TTree::Branch. If your code is compiled just issue (literaly):gROOT->ProcessLine("#include <map>");(and add #include “TROOT.h”).