Data member with index 0 is not found in class SOMECLASS

Dear experts

I tried to save some customized objects inherited from TObject, but when I check the output root file I got errors:

root [3] .L $OAEVENTROOT/lib/liboaEvent.so 
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::ISHAHashValue
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::ISHAHashValue for parent COMET::IAlignmentId!
Warning in <TClass::PostLoadCheck>: 
   The StreamerInfo version 2 for the class COMET::IDigit which was read
   from a file previously opened has the same version as the active class
   but a different checksum. You should update the version to ClassDef(COMET::IDigit,3).
   Do not try to write objects with the current class definition,
   the files will not be readable.

Warning in <TStreamerInfo::CompareContent>: The on-file layout version 2 for class 'COMET::IDigit'  has a base class (TObject) that the in-memory layout version 2 does not have
Warning in <TStreamerInfo::CompareContent>: The following data member of
the in-memory layout version 2 of class 'COMET::IDigit' is missing from 
the on-file layout version 2:
   COMET::IChannelId fChannelId; //
Warning in <TStreamerInfo::CompareContent>: The following data member of
the in-memory layout version 2 of class 'COMET::IDigit' is missing from 
the on-file layout version 2:
   COMET::IHandle<COMET::ITrigger> fTrigger; //
Warning in <TClass::PostLoadCheck>: 
   The StreamerInfo version 10 for the class COMET::IVHandle which was read
   from a file previously opened has the same version as the active class
   but a different checksum. You should update the version to ClassDef(COMET::IVHandle,11).
   Do not try to write objects with the current class definition,
   the files will not be readable.

Warning in <TStreamerInfo::CompareContent>: The on-file layout version 10 for class 'COMET::IVHandle'  has a base class (TObject) that the in-memory layout version 10 does not have
Warning in <TStreamerInfo::CompareContent>: The following data member of
the in-memory layout version 10 of class 'COMET::IVHandle' is missing from 
the on-file layout version 10:
   COMET::IHandleBase* fHandle; //
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::IDigit
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::IDigit for parent COMET::ICDCDigit!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::IChannelId
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::IChannelId for parent COMET::ICDCDigit!
Error in <TProtoClass::FindDataMember>: data member with index 1 is not found in class COMET::IDigit
Error in <CreateRealData>: Cannot find data member # 1 of class COMET::IDigit for parent COMET::ICDCDigit!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::IVHandle
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::IVHandle for parent COMET::ICDCDigit!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::ISHAHashValue
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::ISHAHashValue for parent COMET::ICOMETEvent!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::ISHAHashValue
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::ISHAHashValue for parent COMET::ICOMETEvent!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::IDataVector
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::IDataVector for parent COMET::ICOMETEvent!

This happened when I open the root file with Cling and read some libraries related to root.
Any suggestion please?

Hi Siyuan,

I am sorry to read you are encountering this issue.
It seems that you generated a dictionary with a version of ROOT, compiled it into a library and trying to use it with a different version.
Can this be the case? If yes, you just need to regenerate the dictionary and recompile it with your current ROOT version.

Cheers,
D

Dear Danilo
Thank you for your explanation, I tried to update my ClassDef() in class, bu still got errors:

root [1] .L $OAEVENTROOT/lib/liboaEvent.so 
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::ISHAHashValue
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::ISHAHashValue for parent COMET::IAlignmentId!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::IDigit
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::IDigit for parent COMET::ICDCDigit!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::IChannelId
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::IChannelId for parent COMET::ICDCDigit!
Error in <TProtoClass::FindDataMember>: data member with index 1 is not found in class COMET::IDigit
Error in <CreateRealData>: Cannot find data member # 1 of class COMET::IDigit for parent COMET::ICDCDigit!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::IVHandle
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::IVHandle for parent COMET::ICDCDigit!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::ISHAHashValue
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::ISHAHashValue for parent COMET::ICOMETEvent!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::ISHAHashValue
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::ISHAHashValue for parent COMET::ICOMETEvent!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::IDataVector
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::IDataVector for parent COMET::ICOMETEvent!
Error in <TProtoClass::FindDataMember>: data member with index 1 is not found in class COMET::IDataVector
Error in <CreateRealData>: Cannot find data member # 1 of class COMET::IDataVector for parent COMET::ICOMETEvent!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::IDatum
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::IDatum for parent COMET::ICOMETEvent!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::IDatum
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::IDatum for parent COMET::IData!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::IDatum
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::IDatum for parent COMET::IDigitContainer!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class COMET::IVHandle
Error in <CreateRealData>: Cannot find data member # 0 of class COMET::IVHandle for parent COMET::IHandle<COMET::ITrigger>!

Seems these are not related to the version problem…

Any suggestions?

Any suggestion…?

Hi,

Did you regenerate the dictionary and library? Do you have a minimal reproducer?

Best,
D

Did you add these classes like COMET::ISHAHashValue to the LinkDef file?