G’day,
I'm seeing something strange when compiling in Cygwin that I don't see with Linux. I see this with both root 4.02 and root 5.08.
In the attached tar.gz file,
I first go to the HighLevelObjects directory and make a shared library (‘make’). This just makes an object ‘evt’ and compiles it and its dictionary to a shared library.
I then go to fakeTuple, make it and run it (make; ./fakeTuple.exe). This makes a root file with one ‘evt’ per event stored in a TClonesArray for 10 events.
Finally, I go to topAnaExample make and run it (make; ./topAnaExample.exe). This should just print out the run and event numbers.
For hooking up the tclonesarray, I do:
// evt
TClonesArray *evtTcaPtr = new TClonesArray("evt", 1);
chainPtr->GetBranch("evt")->SetAutoDelete(false);
chainPtr->SetBranchAddress("evt", &evtTcaPtr);
branchNameVec.push_back("evt");
When this happens, I get
Error in <TClonesArray::TClonesArray>: evt is not a valid class name
Warning in <TClass::TClass>: no dictionary for class evt is available
and the code crashes as it tries to access this branch.
If, instead, I ask it to hook the same thing up again
TClonesArray *evtTcaPtr = new TClonesArray("evt", 1);
chainPtr->GetBranch("evt")->SetAutoDelete(false);
chainPtr->SetBranchAddress("evt", &evtTcaPtr);
branchNameVec.push_back("evt");
evtTcaPtr = new TClonesArray("evt", 1);
chainPtr->GetBranch("evt")->SetAutoDelete(false);
chainPtr->SetBranchAddress("evt", &evtTcaPtr);
branchNameVec.push_back("evt");
I get the same warning messages from the first time I hooked up ‘evt’, but no error messages from the second time and it successfully reads out the evt.
If I have two or more objects, it complains about the first one, but not any subsequent classes.
If I load the shared library into root interactive (gSystem->Load("…/shlib/libHighLevelObjects");), it doesn’t complain when I then load the file (i.e. it doesn’t tell me that there is no dictionary for ‘evt’ class).
I do not get any error messages when running on linux (kai and root 3.X and gcc and root 4.x).
I’m assuming I’m doing something stupid in one of my makefiles, but I can’t see what it is.
Cheers,
Charles
p.s. As I said, this happens in 4.02 and 5.08. In 5.08, you have to comment out the following line in topAnaExample.cc. What are we supposed to use instead in root5?
TAuthenticate::SetGlobalUser("cdfdata");
p.s. I seem to be having problems attaching the .tar.gz file so:
www-cdf.fnal.gov/~cplager/broken.tar.gz
broken.tar.gz (31.5 KB)