Rootcling dictionary generation failure

I am porting code that works on root5.34 (and earlier) to produce a library loadable for my analysis code and root macros. It fails on root6.02.05 even after I have modified it to correspond to root6 examples. The errors are:
g++ -std=c++11 Dic.C -c -o Dic.o -I/home/olin/root6/root-6.02.05/include -O2 -g -std=c++11 -Wall -Wno-deprecated -fPIC -m64
Dic.C: In member function ‘virtual void TVF48SiMap::Streamer(TBuffer&)’:
Dic.C:132:27: error: ‘std::string’ has no member named ‘Streamer’
siname_[0][R__i].Streamer(R__b);
^
Dic.C:138:24: error: ‘std::string’ has no member named ‘Streamer’
Siname_[R__i].Streamer(R__b);
^
Dic.C:153:27: error: ‘std::string’ has no member named ‘Streamer’
siname_[0][R__i].Streamer(R__b);
^
Dic.C:159:24: error: ‘std::string’ has no member named ‘Streamer’
Siname_[R__i].Streamer(R__b);
^
They occur using both gcc4.8.3 and gcc 4.9.2, independent of whether I use rootcint or rootcling and independent of the -std=c++11 flag.

I can work around this by replacing the string declarations with TString, but then I get warnings:

bin/Dic.C: In member function ‘virtual void TVF48SiMap::Streamer(TBuffer&)’:
bin/Dic.C:2660:40: warning: iteration 48u invokes undefined behavior [-Waggressive-loop-optimizations]
siname_[0][R__i].Streamer(R__b);
^
bin/Dic.C:2659:7: note: containing loop
for (R__i = 0; R__i < 384; R__i++)
^
bin/Dic.C:2681:40: warning: iteration 48u invokes undefined behavior [-Waggressive-loop-optimizations]
siname_[0][R__i].Streamer(R__b);
^
bin/Dic.C:2680:7: note: containing loop
for (R__i = 0; R__i < 384; R__i++)

The compilation was
g++ -I/home/olin/root6/root-6.02.05/include -O2 -g -std=c++11 -Wall -Wno-deprecated -fPIC -m64 -c TVF48SiMap.cxx -o TVF48SiMap.o
/home/olin/root6/root-6.02.05/bin/rootcint -f Dic.C TVF48SiMap.h alphaAnalysisLinkDef.h
g++ -std=c++11 Dic.C -c -o Dic.o -I/home/olin/root6/root-6.02.05/include -O2 -g -std=c++11 -Wall -Wno-deprecated -fPIC -m64
TVF48SiMap.h (1.81 KB)
TVF48SiMap.cxx (4.96 KB)
alphaAnalysisLinkDef.h (153 Bytes)

Hi Olin,

thanks for reporting: I can reproduce the issue.
On the other hand, the standard and strongly suggested way of selecting classes is with a “+”, i.e. enabling “modern” streaming of classes. This streaming is more performant in terms of runtime, allows schema evolution and advanced error recovery mechanisms.
With a slight modification of your LinkDef, the example works both on 6.02 and 6.04:

cheers,
Danilo

Thanks Danilo. Your fix allows my code to compile and link. There are unfortunately still runtime errors that may be related, (Error in TClass::LoadClassInfo: no interpreter information for class TSisEvent is available eventhough it has a TClass initialization routine.) but I will try to identify it better and then post another report if I
can’t work it out.
This issue is closed.

Hi,

looking at the last line of the post I understand you solved the problem: is this the case?

Cheers,
Danilo

Hello,

I have this sam problem

Error in TClass::LoadClassInfo: no interpreter information for class [class] is available eventhough it has a TClass initialization routine

with a script compiled with CMake. I tried to set the ROOT_INCLUDE_PATH to point to the header, but it doesn’t seem to solve my problem. Do you have a prescription on how to fix it? If needed I’ll try to provide a minimal example.

Thanks and cheers,
Marianna

Hi Marianna,

you respawned a 3y old topic :slight_smile: Could you re-open a new topic and add some context such as your os, root version and reproducer?

Cheers,
D