gROOT and gStyle in compiled code

Hi,

I’ve been trying to run my code using:
x. code.c++
This way any reference to gStyle and gROOT is not valid. I was wondering how I can still set parameters such as:

gROOT->SetStyle("myStyle");
gStyle->SetOptFit(1);
gROOT->cd(0); // to force subsequent objects to be memory-resident

Cheers,
N.

Just add the related includes in your code:

#include <TROOT.h>
#include <TStyle.h>
1 Like