Old .cc file compiled in root 5.34.14

Hi.

My old computer just died so I just installed root_v5.34.14 in ubuntu 14.04 about a month ago.

I compiled succesfully a couple of old root .cc files with no problem. The .cc files used to work
with no issues in the old root installation (I think it is 5.30/02).

Now, some of the .cc compiled files work nicely and some other don’t.
In the ones it doesn’t,
it seems it all has to do with a TTree library:

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 TLeaf 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 TLeafI is available
Warning in TClass::TClass: no dictionary for class TLeafF is available
Error in TBufferFile::ReadClassBuffer: class: TNamed, attempting to access a wrong version: 18, object skipped at offset 66
Error in TBufferFile::CheckByteCount: object of class TNamed read too few bytes: 2 instead of 115980

After debugging and looking where is the program crashing…
The problem seems to be when I try to fill variables from a Tree this way:

TFile *f1 = new TFile("…/…/…/Data/TupluTry.root");

TTree tuplu1 = (TTree)f1->Get(“K/Tuple”);
Int_t nentries1 = (Int_t)tuplu1->GetEntries();

tuplu1->SetBranchAddress(“motherM”,&motherM);

How can I do this in root 5.34.14?
Any help would be appreciated.

Hi,

the warnings you reported do not appear at compile time but rather at runtime.
They mean that the dictionaries for those clsses are not available. The dictionaries for those classes are created during the building procedure, compiled and linked into libTree.
Did you encounter any problem while building ROOT? How did you build?
The first step towards the solution would consist in re-configuring and re-building ROOT.

Danilo

I build root the following way:

sudo apt-get install gfortran libssl-dev libpcre3-dev libglu1-mesa-dev libglew-dev libftgl-dev libmysqlclient-dev libfftw3-dev libcfitsio3-dev graphviz-dev libavahi-compat-libdnssd-dev libldap2-dev python-dev libxml2-dev libkrb5-dev libgsl0-dev libqt4-dev

sudo apt-get install xfs xfstt
sudo apt-get install t1-xfree86-nonfree ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac xfonts-75dpi xfonts-100dpi
service xfs start

wget ftp://root.cern.ch/root/root_v5.34.14.source.tar.gz
gzip -dc root_v5.34.14.source.tar.gz | tar -xf -

sudo mkdir /usr/include/freetype && sudo cp /usr/include/freetype2/freetype.h /usr/include/freetype/freetype.h

cd root
./configure --all
make -j 4

And it builds all the way without any trouble.

The .cc file is built the following way in the Makefile:

CXX = g++
LD = g++
CFLAGS = -O2
INCS = $(ROOTSYS)/include
LIBS = $(ROOTSYS)/lib

omegate: omegate.o
@echo “omegate”
$(LD) $^ $(shell $(ROOTSYS)/bin/root-config --libs) -Wall -lGui -lm -o omegate

In your “main” routine, do you [url=https://root-forum.cern.ch/t/missing-include/17674/2 a “TApplication” object[/url] (needed for [url=https://root-forum.cern.ch/t/linking-problem-to-libtree-so/13697/12 of ROOT classes[/url])?
BTW. Note that ROOT 5.34/14 is very old. You’d better take the head of the “v5-34-00-patches” branch.

Thank you :slight_smile: The “TApplication” object made it work.

[quote=“Pepe Le Pew”]In your “main” routine, do you [url=https://root-forum.cern.ch/t/missing-include/17674/2 a “TApplication” object[/url] (needed for [url=https://root-forum.cern.ch/t/linking-problem-to-libtree-so/13697/12 of ROOT classes[/url])?
BTW. Note that ROOT 5.34/14 is very old. You’d better take the head of the “v5-34-00-patches” branch.[/quote]