Re: root functions in c++ code

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Mon, 23 Aug 2010 16:27:32 +0200


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>> 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
Received on Mon Aug 23 2010 - 16:27:36 CEST

This archive was generated by hypermail 2.2.0 : Sun Aug 29 2010 - 17:50:01 CEST