Hi,
I have a class that I also generate a dictionary for, using rootcint. Well recently, I needed to use some of the new features in the C++11 and added unordered_map as a data member in my class. But when I went on to get rootcint to generate a dictionary for it, I get this error:
Generating dictionary MyClassDict.cpp...
Error: cannot open file "unordered_map" MyClass.h:12:
Error: Symbol unordered_map is not defined in current scope MyClass.h:81:
Error: Symbol long,PopData is not defined in current scope MyClass.h:81:
Error: Symbol popMap is not defined in current scope MyClass.h:81:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing MyClassDict.cpp MyClassDict.h !!!
Error: rootcint: error loading headers...
The line it is complaining about in my MyClass.h is the include of the std::unordered_map:
#include <unordered_map>
Of which my compiler has no problem referencing this header in my other non-root related code.
In my makefile for generating root standalone executables, I have this:
MyClassDict.cpp: MyClass.h MyClassLinkDef.h
@echo "Generating dictionary $@..."
@rootcint -f MyClassDict.cpp -c MyClass.h MyClassLinkDef.h
where MyClassLinkDef.h has this:
[code]
#ifdef CINT
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class MyClass+;
#endif[/code]
I do compile my code with the -std=c++11 option, where my g++ version is:
g++ (GCC) 4.8.2 20131017 (Red Hat 4.8.2-1)
Does not rootcint support C++11? Is there some option I should be passing to rootcint for it to recognize this unordered_map header? The root version I have is ROOT 5.34/10.
BTW the unordered_map is also available without the -std=c++11 option. If I use the namespace tr1, it will find it, that is if I referenced the header as:
#include <tr1/unordered_map>
But the rootcint still can’t find this header:
Generating dictionary MyClassDict.cpp...
Error: cannot open file "tr1/unordered_map" MyClass.h:12:
Help?