Re: Problem reading object from root file

From: Carlos Osuna <Carlos.Osuna_at_ifae.es>
Date: Thu, 26 May 2005 09:28:06 +0200


Right, I forgot to add this library. Thanks

carlos

Philippe Canal wrote:

>Hi,
>
>You need to link your executable with libTree.so (-lTree)
>
>Cheers,
>Philippe.
>
>-----Original Message-----
>From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch]
>On Behalf Of Carlos Osuna
>Sent: Wednesday, May 25, 2005 10:03 AM
>To: roottalk_at_pcroot.cern.ch
>Subject: [ROOT] Problem reading object from root file
>
>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 Thu May 26 2005 - 09:28:16 MEST

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