I’m creating a TTree with a class that inherits from a base class, without a problem. However, in the same program a couple lines later,
TClass branchClass(c->GetBranch("event")->GetClassName());
if (branchClass.InheritsFrom("dicttest::EventDis") {....}
fails with
Warning in <TClass::TClass>: no dictionary for class dicttest::EventPythia is available
Error in <TObjArray::At>: index 0 out of bounds (size: 1, this: 0x127faed70)
Error in <TObjArray::At>: index 0 out of bounds (size: 1, this: 0x127faed70)
It works fine interactively but not when compiled. I have a demonstrator that’s pretty minimal here:
This behavior is new to root 6.24, tested on Apple M1 and Ubuntu. The same code worked fine in root 6.20.04; I haven’t been able to test other versions.
I also opened an issue at Root 6.24: New bug with compiled code using TClass / dictionaries · Issue #8250 · root-project/root · GitHub but this may be the better forum to check whether I am doing something wrong.
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.24
Platform: Both M1 and Ubuntu
Compiler: clang, gcc