Error compiling dictionary

Hello,
I’m trying to update from ROOT 5.34 to ROOT 6 on my laptop. The installation was successful so I’m trying to recompile my custom libraries to use them with the new version of ROOT but I came across an error when trying to compile the dictionary file generated by rootcling. The error is the following:

/usr/bin/c++ -DFPam_EXPORTS -DNOL2 -fPIC -I/Users/formato/root/include -I/Users/formato/Workstuff/devel/FPam_cling/inc -o CMakeFiles/FPam.dir/FPamDict.cpp.o -c /Users/formato/Workstuff/devel/FPam_cling/build/FPamDict.cpp /Users/formato/Workstuff/devel/FPam_cling/build/FPamDict.cpp:418:56: error: expected expression TriggerDictionaryInitialization_FPamDict_Impl, {}, classesHeaders); ^
and it is in the following section of the dictionary:

static bool isInitialized = false; if (!isInitialized) { TROOT::RegisterModule("FPamDict", headers, includePaths, payloadCode, TriggerDictionaryInitialization_FPamDict_Impl, {}, classesHeaders); isInitialized = true; }

With ROOT 5.34 I was able to compile and link the library but now, not knowing what’s under the hood of the dictionary generation, I don’t know how to solve this issue.

Hi Valerio,

the error you are seeing is linked to the fact that you are not compiling the dictionary with the c++11 standard enabled (-std=c++11 from commandline with a c++11 capable compiler like gcc). More specifically, in this case, the compiler cannot deal with the empty initialiser list “{}”.
Note that this is the manifestation of a feature of ROOT6, i.e. the requirement of C++11.

Cheers,
Danilo

Thanks, it worked!