Hi,
I have built a template “TProofCollection” inheriting from both TNamed and std::vector:
[code]template
class TProofCollection:public TNamed, public std::vector {
public:
TProofCollection(const char* title = “”, const char* name = “”):
TNamed(title, name) {}
…
protected:
ClassDef(TProofCollection,1);
};
typedef TProofCollection TProofCollectionI;
typedef TProofCollection TProofCollectionF;
typedef TProofCollection TProofCollectionD;
[/code]
On the .C file I just have to do:
[code]#include “TProofCollection.h”
#if !defined(CINT)
templateClassImp(TProofCollection);
#endif[/code]
And then I can build TProofCollection’s of ints, floats and doubles.
However when I try to have a TProofCollection (where EventInfo is some private class inheriting from TObject with a few fields) I am able to compile everything with ACLIC (no errors), but I cannot even construct an object of that class with the error:
Error: Can't call TProofCollection<EventInfo>::TProofCollection<EventInfo>("Name","Title") in current scope proofcollection.C:36:
Possible candidates are...
(in TProofCollection<EventInfo>)
*** Interpreter error recovered ***
If I try to build a TSelector derived class that uses a TProofCollection I get:
Info in <TUnixSystem::ACLiC>: creating shared library /mnt_pool/fanaeXXX/user/iglez/PROOF/TopAnalysis/./MyAnalysisMiniTrees_C.so
dlopen error: /mnt_pool/fanae105/user/iglez/PROOF/TopAnalysis/./MyAnalysisMiniTrees_C.so: undefined symbol: _ZN16TProofCollectionI9EventInfoE11ShowMembersER16TMemberInspectorPc
Load Error: Failed to load Dynamic link library /mnt_pool/fanaeXXX/user/iglez/PROOF/TopAnalysis/./MyAnalysisMiniTrees_C.so
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/mnt_pool/fanaeXXX/user/iglez/PROOF/TopAnalysis/./MyAnalysisMiniTrees_C_ACLiC_dict.o: In function `TProofCollection<EventInfo>::IsA() const':
MyAnalysisMiniTrees_C_ACLiC_dict.cxx:(.text._ZNK16TProofCollectionI9EventInfoE3IsAEv[TProofCollection<EventInfo>::IsA() const]+0xd): undefined reference to `TProofCollection<EventInfo>::Class()'
/mnt_pool/fanaeXXX/user/iglez/PROOF/TopAnalysis/./MyAnalysisMiniTrees_C_ACLiC_dict.o:(.data.rel.ro._ZTV16TProofCollectionI9EventInfoE[vtable for TProofCollection<EventInfo>]+0x1d0): undefined reference to `TProofCollection<EventInfo>::ShowMembers(TMemberInspector&, char*)'
/mnt_pool/fanaeXXX/user/iglez/PROOF/TopAnalysis/./MyAnalysisMiniTrees_C_ACLiC_dict.o:(.data.rel.ro._ZTV16TProofCollectionI9EventInfoE[vtable for TProofCollection<EventInfo>]+0x1d8): undefined reference to `TProofCollection<EventInfo>::Streamer(TBuffer&)'
collect2: ld returned 1 exit status
*** Interpreter error recovered ***
Which points me to some problem in the ACLIC creation of the dictionaries. I wonder if I have hit a limitation in ACLIC/ROOT or, most probably, I am missing something on my code.
I have attached the quite simple code. Just unpack it and run proofcollection.C to see the effect.
proofcollection.tar.gz (66.9 KB)