I was wondering what is the official way to have CINT understand map<string, string>; I’ve tried using #pragma link C++ class std::map<std::string, std::string>; but this doesn’t seem to work.
[quote]Error: link requested for unknown class std::mapstd::string,std::string testCINT.C:11: [/quote]You need to uncomment the include for the header of both map and string …
I added it and this is what I get:
Error: Can’t call map<string,string,less,allocator<pair<const string,string> > >::operator in current scope testCINT.C:40:
Possible candidates are…
(in map<string,string,less,allocator<pair<const string,string> > >)
Error: improper lvalue testCINT.C:40:
(class string)49957104
*** Interpreter error recovered ***
[quote]Error: Can’t call map<string,string,less,allocator<pair<const string,string> > >::operator in current scope testCINT.C:40:
[/quote]This now means that you have not loaded the dictionary for map<string,string>. What are the exact step you are executing?
So you do not generate the dictionary for the map.
You can either just compile your whole script ( .x testCINT.C+ ) or compile a file containing just the dictionary request/* loader.C */
#include <string>
#include <map>
#ifdef __MAKECINT__
#pragma link C++ class std::map<std::string, std::string>;
#endifand use.L loader.C+
.x testCINT.C