Hi Danilo
I’m having trouble making a stand-alone example for this. I copied the whole build system
and removed everything but the KVSeqCollection base class, generated the .so and guess what:
no problems
i.e. the KVSeqCollection::Class()->GetListOfDataMembers() always gives a valid list.
The only difference I could find in the dictionary code between this and the full library was
(KVSeqCollection compiled on its own):
class __attribute__((annotate(R"ATTRDUMP(KaliVeda extensions to ROOT collections)ATTRDUMP"))) __attribute__((annotate("$clingAutoload$base/KVSeqCollection.h"))) KVSeqCollection;
(KVSeqCollection compiled with all the other classes):
class __attribute__((annotate(R"ATTRDUMP(KaliVeda extensions to ROOT collections)ATTRDUMP"))) __attribute__((annotate("$clingAutoload$base/KVUniqueNameList.h"))) KVSeqCollection;
I don’t know what this does, but there seems to be some interference between classes:
KVUniqueNameList derives from KVSeqCollection, but not directly; there is an intermediate
class KVHashList (KVSeqCollection <- KVHashList <- KVUniqueNameList)
So I added the two derived classes to my stand alone example, now the ‘class__attribute’ is the same
as for the real library, but still the problem is not reproduced.
The dictionary is generated with
rootcling -v -f KVMultiDetbaseDict.cpp -rml libKVMultiDet.so -rmf libKVMultiDetbase.rootmap -c -p -Ibase -DWITH_OPENGL -I/home/john/work/kaliveda_debug/ROOT6/KVSeqCollection_example -I/home/john/work/kaliveda_debug/ROOT6/KVSeqCollection_example/build/include base/KVUniqueNameList.h base/KVSeqCollection.h base/KVHashList.h base/KVMultiDetbaseLinkDef.h
My (reduced) link def is
#ifdef __CINT__
#include "RVersion.h"
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ nestedclass;
#pragma link C++ nestedtypedef;
#pragma extra_include "Rtypes.h";
#pragma link C++ class KVSeqCollection-;
#pragma link C++ class KVHashList+;
#pragma link C++ class KVUniqueNameList+;
#endif
N.B. the order of the 3 classes is the same as in the real linkdef.
Dictionary compilation:
g++ -Wall -Wextra -Werror=overloaded-virtual -Werror=non-virtual-dtor -Werror=type-limits -Werror=sign-compare -Werror=unused-but-set-variable -Wno-format-security -Wno-unused-parameter -Wunused-but-set-parameter -Wunused-variable -Wall -fPIC -pthread -std=c++11 -Wno-deprecated-declarations -m64 -I/home/john/software/build/root-v6-02-00/include -Ibase -DWITH_OPENGL -I/home/john/work/kaliveda_debug/ROOT6/KVSeqCollection_example -I/home/john/work/kaliveda_debug/ROOT6/KVSeqCollection_example/build/include -c -o KVMultiDetbaseDict.o KVMultiDetbaseDict.cpp
Shared library generation:
c++ -shared -m64 -O3 -Wl,--no-as-needed -Wl,--no-undefined base/KVUniqueNameList.o base/KVSeqCollection.o base/KVHashList.o KVMultiDetbaseDict.o -L/home/john/software/build/root-v6-02-00/lib -lGui -lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic -L/home/john/software/build/root-v6-02-00/lib -lRGL -L/home/john/software/build/root-v6-02-00/lib -lGeom -L/home/john/software/build/root-v6-02-00/lib -lSpectrum -L/home/john/software/build/root-v6-02-00/lib -lProofPlayer -lProof -o libKVMultiDet.so
By the way, since updating v6-02-00-branches, I no longer have a segmentation violation in TProtoClass,
rather some new error messages appear:
Error in <CreateRealData>: Cannot find data member # 0 of class KVSeqCollection for parent KVUniqueNameList!
Error in <TProtoClass::FindDataMember>: data member with index 1 is not found in class KVSeqCollection
Error in <CreateRealData>: Cannot find data member # 1 of class KVSeqCollection for parent KVUniqueNameList!
Error in <TProtoClass::FindDataMember>: data member with index 0 is not found in class KVSeqCollection
Error in <CreateRealData>: Cannot find data member # 0 of class KVSeqCollection for parent KVHashList!
Error in <TProtoClass::FindDataMember>: data member with index 1 is not found in class KVSeqCollection
Error in <CreateRealData>: Cannot find data member # 1 of class KVSeqCollection for parent KVHashList!
I am really stuck now. As I said at the beginning, it might be easier to debug with 5.34, i.e. if I could
only understand why CINT/rootcint would claim that a dictionary is not available for a class when
it is not the case?
Thanks for your help