Strange compilation error: undefined reference

Since last week, I keep getting this error when trying to compile C++ programs that use ROOT functions such as histograms:

/tmp/ccaOk6lo.o: In function __static_initialization_and_destruction_0(int, int)': analyse124b.C:(.text+0x1655): undefined reference toTVersionCheck::TVersionCheck(int)’
/tmp/ccaOk6lo.o: In function .L826': analyse124b.C:(.text+0x3ffd): undefined reference toTStorage::ObjectAlloc(unsigned int)‘
analyse124b.C:(.text+0x403d): undefined reference to `TH1F::TH1F(char const*, char const*, int, double, double)’

I am using Kubuntu 7.10 with KDE 3.58. For compiling I use gcc via makefile. As far as I am aware of, I did not change anything in my system in the last weeks. Neither did I add any ROOT functions to my programs that weren’t included before.

Do you specify the ROOT libs like libHist, licOre when linking your application?
Can you run root.exe ?


I include various ROOT libraries at the beginning of the program:

#include <TROOT.h> #include <TChain.h> #include <TLine.h> #include <TFile.h> #include <TH2.h> #include <TH1.h> #include <TStyle.h> #include <TCanvas.h> #include <math.h> #include <fstream> #include <iostream> #include <TBrowser.h> #include <TGClient.h> #include <TGFrame.h> #include <TThread.h> #include<TCutG.h> #include <TRootEmbeddedCanvas.h> #include <RQ_OBJECT.h> #include <sys/stat.h>

In my Makefile, I have:



ROOTCFLAGS := $(shell root-config --cflags)
ROOTLIBS := $(shell root-config --libs)
ROOTGLIBS := $(shell root-config --glibs)

I still can run root.exe, it’s working as always.

Still haven’t found a solution - anyone got an idea?


What is the actual command that lead to the error?


Oh well, it was just a problem with my makefile.