ROOT is having problems creating a pointer to my map.
The map is created at line 23 in the attached code:
map<char, int> m;
The pointer setup is at line 41:
map<char, int>::iterator iterp;
The root output is as below. ROOT is happy to execute functions directly on my map object, m - but crashes when the pointer code is used. Suggestions much appreciated. Thanks, Dave.
********************* >>>>>>>>>>>>>>
The ROOT version in use is:
/cvmfs/cms.cern.ch/slc6_amd64_gcc472/lcg/root/5.32.00
End of messages from /afs/cern.ch/user/d/davec/rootlogon.C:
root [0] .L map-test.C
root [1] main()
map m is empty - fill it !
map m is not empty now
Number of map entries = 26
Error: Symbol iterp is not defined in current scope map-test.C:47:
Error: Failed to evaluate iterp->second
Its ASCII value is (class G__CINT_ENDL)10754800
*** Interpreter error recovered ***
A2) You can simply try to execute “.L map-test.C++” again. In ROOT 5 you may get a warning that some iterator is already in TClassTable but there should be no such warning in ROOT 6 (neither when used via ACLiC nor when used as “interpreted”).
Note: if you rename your file into “mtest.C”, you should be able to (re)load and execute it using simply “.x mtest.C++” (in ROOT 6, you can also try “.x mtest.C”).