G++ using root-config cannot find... something

Hey everyone, I’m a newbie to ROOT and I’ve run into some trouble trying to compile my first cpp file. I don’t know if the problem is with g++ or with my ROOT setup… I type:

g++ Analyze.cc -o Analyze root-config --libs --cflags

And the system outputs:

/usr/bin/ld: cannot find -lGraf3d
/usr/bin/ld: cannot find -lPostscript
/usr/bin/ld: cannot find -lPhysics
collect2: error: ld returned 1 exit status

I’m using g++ version 4.9.1 on Ubuntu 14.10.

So, what do you think is going on?

1 Like

See what you get when you try:
root-config --prefix
root-config --cflags
root-config --libs

root-config --prefix:

root-config --cflags:
-pthread -m64 -I/usr/include/root

root-config --libs:
-L/usr/lib/x86_64-linux-gnu -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic

I have ROOT version 5.34/19 if that’s relevant.

It seems to me that you try to use [url=https://root-forum.cern.ch/t/installation-problems-ubuntu-14-04/18550/25 Ubuntu’s “system-provided” ROOT version[/url].
If this is the case then I think you need to install some additional packages. Search for “root-system*”, “root-plugin*”, “libroot*” packages in your system’s “package manager”.

Thanks, that’s exactly what it is. I installed ROOT originally from the Ubuntu repository using sudo apt-get install root-system, which meant I was missing a lot of stuff. I reinstalled using the source file provided on the CERN download page and it works fine now.

I have just recently run into this as well on the Red Hat side. I’ve install the package labelled as root and I am missing -lPhysics and -lMultiProc. I see that there are packages for root-physics and root-multiproc. Shouldn’t root-config --libs not provide those libs if they are not installed? This would be my expectation and then as I add packages root-config extends the list of libs.

I’ve attempted to notify the package maintainer, but I’m not exactly sure where or who to contact about that. I expect that this issue isn’t directly related to the ROOT team. Is there a reason why the ROOT team does not maintain these type of packages? One for Debian and one for Red Hat? It would greatly simplify life for me and I expect many of your users as well as reduce complaints here about a package that someone else built.