Re: root functions in c++ code

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Mon, 30 Aug 2010 10:22:15 +0200


Hi Zoltan,

now at <http://root.cern.ch/drupal/faq#n657>

Cheers, Axel.

Zoltan Seress wrote on 08/29/2010 04:33 PM:
> Hi Axel,
>
> Thank you for the hint, I could use it. Maybe it is worth to put this
> issue in the faq under a different title. I would have never searched
> for solution to my cmake problem in os x topics.
>
> On Mon, Aug 23, 2010 at 4:27 PM, Axel Naumann <Axel.Naumann_at_cern.ch
> <mailto:Axel.Naumann_at_cern.ch>> wrote:
>
> Hi Zoltan,
>
> see
> <http://root.cern.ch/drupal/content/how-use-root-libraries-xcode-mac-os-x>
> on CMake and ROOT. I don't know how much of that CMake snippet is Xcode
> specific - probably nothing.
>
> Cheers, Axel.
>
>
> Zoltan Seress wrote on 08/23/2010 04:06 PM:
> > Hi Mario,
> >
> > Thank you for the very quick and helpful reply! Now I only have to find
> > how to integrate this into a cmake system.
> >
> > On Mon, Aug 23, 2010 at 1:54 PM, Mario Kadastik
> <mario.kadastik_at_cern.ch <mailto:mario.kadastik_at_cern.ch>
> > <mailto:mario.kadastik_at_cern.ch <mailto:mario.kadastik_at_cern.ch>>> wrote:
> >
> >> Maybe it is a dumb question, but is there a way to call root
> >> functions from a normal c++ code somehow without the use of the
> >> interpreter?
> >> Regards,
> >
> > Yes, just link your code against ROOT. Here's a compile script
> I use
> > to compile against both Pythia and ROOT my private C++ code where I
> > use functions from both.
> >
> > #!/bin/sh
> > g++ -o $1 $1.cc `root-config --cflags --libs --glibs` -L
> > pythia/lib/archive -lpythia8 -llhapdfdummy -I pythia/include
> >
> > the relevant part for you is the root-config part I guess. In the
> > code you then just need to include the necessary header files..
> i.e.
> >
> > #include "TFile.h"
> > #include "TH1.h"
> > #include "TH2.h"
> > ...
> >
> > Enjoy,
> >
> > Mario Kadastik, PhD
> > Researcher
> >
> > ---
> > "Physics is like sex, sure it may have practical reasons, but
> > that's not why we do it"
> > -- Richard P. Feynman
> >
> >
> >
> >
> > --
> > Zoli
>
>
>
>
> --
> Zoli
Received on Mon Aug 30 2010 - 10:22:21 CEST

This archive was generated by hypermail 2.2.0 : Tue Aug 31 2010 - 17:50:02 CEST