ROOT complier issue

Please read tips for efficient and successful posting and posting code

ROOT Version: 6.24/02
Platform: Ubuntu Linux20.4
Compiler: gcc

Hi there!
I am having issues compiling with MakeFile


Hi @Philomath ,
you use $(ROOTCFLAGS) and $(ROOTLFLAGS) but they don’t seem to ever be defined?

To debug this you should ask make to produce a verbose output (I think make VERBOSE=1 should work) and inspect the actual compilation commands being used. They should contain -I/path/to/your/root/installation and analogous -L and -l flags.


Hi @Philomath,

To complement @eguiraud answer, and if root-config can be located in the PATH environment variable, you can define both missing variables as:

ROOTCFLAGS=$(shell root-config --cflags)
ROOTLFLAGS=$(shell root-config --libs)


Thank you very much! @eguiraud & @jalopezg, your solutions worked. I am kind a newb at this, can you please explain why those 2 variables where important?

Hi @Philomath,

After the previous assignment, ROOTCFLAGS will contain the required compiler flags, e.g. include search path (-I/path/to/root_install_dir/include/xxx…), etc. (actually, the error you were getting was due to TFile.h not being found in the include search path).
Same for ROOTLFLAGS, which will be initialized with the library search path (-L/path/to/root_install_dir/lib) and the required libraries (-lxxx).

If you are happy with the reply, could you please mark the topic as solved? :slight_smile:


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.