Problem reading object from root file

From: Carlos Osuna <Carlos.Osuna_at_ifae.es>
Date: Wed, 25 May 2005 17:03:17 +0200


Hi,
running the following piece of code from a C program I get the error below. What is strange is that if I execute the same code as a root macro there is no problem.
I found a report with the same error:
http://root.cern.ch/root/roottalk/roottalk03/1544.html (that seems to be solve) but executing the code as a macro, so it is not exactly the same problem. I tested with 4.03.02 (slc3_ia32_gcc323).

#include <iostream.h>
#include "TObject.h"
#include "TNtuple.h"
#include "TFile.h"
#include "TKey.h"
#include "TList.h"

int main( int argc, char *files[] )
{
  TFile *f = new TFile(
"rome.004804.recov10.A10_300_Atautau_filter.1.30748.root" );   TList *l = f->GetListOfKeys();
  TKey *key;
  key = ((TKey*) l->At(0));
  TObject *obj = key->ReadObj();
}

Warning in <TClass::TClass>: no dictionary for class TLeaf is available
Warning in <TClass::TClass>: no dictionary for class TTree is available
Warning in <TClass::TClass>: no dictionary for class TBranch is available
Warning in <TClass::TClass>: no dictionary for class TVirtualIndex is 
available
Warning in <TClass::TClass>: no dictionary for class TBranchRef is available
Warning in <TClass::TClass>: no dictionary for class TLeafD is available
Warning in <TClass::TClass>: no dictionary for class TLeafI is available
Error in <TClass::ReadBuffer2>: class: TNamed, attempting to access a wrong version: 15, object skipped at offset 72 Error in <TBuffer::CheckByteCount>: object of class TNamed read too few bytes: 2 instead of 894666

Does anybody know what could be happening? Received on Wed May 25 2005 - 17:03:23 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:08 MET