loccie
May 23, 2016, 1:02pm
#1
Hi,
When trying to compile the file TopCrossection.cc , which includes ROOT
statements, with the following command line:
g++ .cc src/ .cc -o TopCrossSection -I./include -I’root-config
–incdir’‘root-config --glibs’ -std=c++11 -Im
I get the error:
In file included from src/CrossSection.cc:15:
/include/CrossSection.h:18:10: fatal error: ‘TROOT.h’ file not found
#include <TROOT.h>
whilst I can open ROOT in the current directory, and TROOT.h is included in
my ROOT folder.
It gives the impression that the path to ROOT is missing, but how is this
possible if I can open ROOT in the command line in the current directory?
Thanks for help.
Elizabeth
mato
May 23, 2016, 1:15pm
#2
The the following command:
g++ *.cc src/*.cc -o TopCrossSection -I./include `root-config --cflags` `root-config --glibs`
Try: `root-config --cxx --cflags` -I./include -o TopCrossSection *.cc src/*.cc `root-config --glibs`
loccie
May 23, 2016, 2:04pm
#5
Thanks for the suggestion. Unfortunately not successful.
pcanal
May 23, 2016, 2:08pm
#6
Then you must have an installation problem. What are the result of:
root-config --cxx --cflags
root-config --glibs
which root.exe
echo $ROOTSYS
Cheers,
Philippe.
loccie
May 23, 2016, 2:16pm
#7
Looks like! although I do not understand what’s wrong.
bash-3.2$ root-config --cxx --cflags
clang++ -pthread -stdlib=libc++ -std=c++11 -m64 -I/Applications/root/include
bash-3.2$ root-config --glibs
-L/Applications/root/lib -lGui -lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lpthread -stdlib=libc++ -lm -ldl
bash-3.2$ which root.exe
/Applications/root/bin/root.exe
bash-3.2$ echo $ROOTSYS
/Applications/root
Cheers
pcanal
May 23, 2016, 2:18pm
#8
Tryclang++ *.cc src/*.cc -o TopCrossSection -I./include `root-config --cflags` `root-config --glibs`
If it does not work, what doesls -l /Applications/root/include
returns?
Philippe.
loccie
May 23, 2016, 2:28pm
#9
bash-3.2$ clang++ .cc src/ .cc -o TopCrossSection -I./include 'root-config --cflags ’ ‘root-config --glibs’
clang: error: no such file or directory: 'root-config --cflags ’
clang: error: no such file or directory: ‘root-config --glibs’
ls -l /Applications/root/include returns:
result.txt (105 KB)
loccie
May 23, 2016, 3:07pm
#11
Many thanks for noticing this stupid mistake. Now it works!!! Thank you to you all.
Best regards,
Elizabeth