I’m sure this question must have been answered somewhere, but I cannot find anything from a Google search or a search of these forums.
I’m trying to use std::map in a macro that I wrote. I want the keys of the map to be of type TString and the values to be of type TGraph*. I have a function that takes a bunch of parameters, creates a new TGraph*, and returns the TGraph*.
I try to return the function and place the the returned value into my std::map, but I keep getting segmentation violations whenever I run the code. I’ve read things about having to tell the root cint to recognize parts of the standard library, but I’m not sure how to do this. When I open cint I type "include ", which seems to deal with removing the symbol not found errors.
Anyway, I’ve attached a small program that reproduces this problem. I’m not sure if the problem is directly attributing to using std::map or not, but I’ve had a lot of trouble just trying to create a std::map, so it seems that a lot of my troubles lie with that.
Thanks for any advice, and sorry if this has been asked and answered many times before.
test.C (501 Bytes)