Issues in compiling with g++

Hi everyone. I installed ROOT and on my terminal i can see that its running well. However, when i try to compile a c++ file (try.cc), it only produces an output file (try.o) and i am unable to get an executable file when i do g++ -o histgui root-config --glibs try.o . I am using Ubuntu 14.04 and my make file is give below:

export ROOTSYS=$HOME/root
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
export PATH=$PATH:$ROOTSYS/bin
g++ -c root-config --cflags try.cc

It will be great if someone could help me in this regard.

Cheers,
Tajdar

Hi,

the right compiler invocation is

g++  `root-config --cflags --libs` try.cc -o try

D

Either simply: `root-config --cxx --cflags` -o histgui try.cc `root-config --glibs` or: `root-config --cxx --cflags` -c try.cc `root-config --cxx --cflags` -o histgui try.o `root-config --glibs`