Re: root functions in c++ code

From: Zoltan Seress <seress.zoltan_at_gmail.com>
Date: Mon, 23 Aug 2010 16:06:40 +0200


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>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:06:50 CEST

This archive was generated by hypermail 2.2.0 : Mon Aug 23 2010 - 17:50:02 CEST