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 isavailable
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 availableError 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 - 19:35:50 MEST
This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:08 MET