Linking libraries - use of undeclared gSystem

Hi All,

I have a macro that prepares a TProof and then processes a TDSet via another C file:

auto dset_channel = new TDSet("TTree", "nominal");
dset_channel->Add(fc_channel->GetList());
auto fProof_channel = TProof::Open("workers=4");
fProof_channel->Process(dset_channel,"Processor.C+");

Inside the Processor class, I have an #include to a file with many functions that I want to use. However, it starts to complain about the use of unidentified objects. Such as, TMath::Pi(), TColor, etc… even though when I run a macro using “root -l -b -q xxx.C” it never complained.

I added a bunch of #includes to overcome the errors but now I get “error: use of undeclared identifier ‘gSystem’” . I don’t know what I should do so I can use gSystem through TProof.

Is there some magical way to link the libraries so that the objects I can use with “root -l -b -q” are also available through the Processor via TProof?

Thanks for your help,
Sergio

In order to use gSystem you need to include the TSystem ROOT header: #include TSystem.h

Thanks for your answer. That solved that error, thanks!

I have another small problem. For running the Processor.C, I need to add some parameters to the fProof file, which I do with:

fProof_channel->AddInput(job_params);

and I also load the file for the class of job_params:

fProof_channel->Load("JobParams.h+");

However, inside JobParams I have an #include to another file that has some functions I want to use. When I try to run the code I get an error of the sort:

././JobParams.h:10:10: fatal error: 'macros/methods.h' file not found
#include "macros/methods.h"
         ^~~~~~~~~~~~~~~~~~~~~~~
09:28:15 22510 Wrk-0.0 | Error in <ACLiC>: Dictionary generation failed!

Do I need to do something to link this “macros/methods.h” file? Should I somehow declare the whole path to the file?

It seems that you are compiling with ACLiC so I would say you need to specify first an include path so that your header is found:

https://root.cern.ch/doc/master/classTSystem.html#a2b8939237273d0e426a00adb3c612916

If you run TSystem->AddIncludePath("path/to/your/headers") it should work.

Thanks!

I ended up doing:

fProof_channel->Load("macros/methods.h+");

I guess your solution would’ve also worked

Sorry to bother again. I get the thing to work but if I want to include anything I start getting errors. Now I have:

error: no type named 'RDataFrame' in namespace 'ROOT'

How can I know what to include? I tried the obvious <RDataFrame.h> but didn’t work.

Thanks!

You get the name of the include file for a given class at the end of its reference guide page. (scroll to the bottom of the page)