Compiling Dictionary for STL Map with ROOT Objects

I’m trying to use a STL map container with ROOT objects, for example

Following Phillipe’s instructions on an old forum post, I created the file loader.C

#include <pair>

#ifdef _MAKECINT_
#pragma link C++ class pair<float, TString>+;

and modified my macro to include

Unfortunately the compilation fails

Info in <TUnixSystem::ACLiC>: creating shared library /Users/Zeplin/Desktop/././
In file included from /Users/Zeplin/Desktop/././tmp_0_k1yGCR.h:32,
                 from /Users/Zeplin/Desktop/././tmp_0_k1yGCR.cxx:16:
/Users/Zeplin/Desktop/././loader.C:1:16: error: pair: No such file or directory
powerpc-apple-darwin8-g++-4.0.1: /Users/Zeplin/Desktop/././tmp_0_k1yGCR.o: No such file or directory
powerpc-apple-darwin8-g++-4.0.1: no input files
Error in <ACLiC>: Compilation failed!
Error: Can't call map<float,TString,less<float>,allocator<pair<const float,TString> > >::operator[]((int)1) in current scope test.C:13:
Possible candidates are...
(in map<float,TString,less<float>,allocator<pair<const float,TString> > >)
Error: improper lvalue test.C:13:

I’m using ROOT 5.14/00e installed on OS X 10.4 via Fink. Has anyone encountered this problem before?


most implementations of STL don’t have a header called . Include instead.



Sorry, my STL knowledge isn’t too great. The switch to worked and the dictionary compiles with ACLiC, but the dictionary doesn’t work with the macro. It dies with the same error had I not included the dictionary,

Error: Can’t call map<float,TString,less,allocator<pair<const float,TString> > >::operator in current scope test.C:14:
Possible candidates are…
(in map<float,TString,less,allocator<pair<const float,TString> > >)
Error: improper lvalue test.C:14:

Any help would be appreciated. Thanks!
loader.C (140 Bytes)
test.C (265 Bytes)

in your loader.C it should say
(two underscores in front and at the end)