Warning: null passed to a callee that requires a non-null argument [-Wnonnull]

Hello dear ROOTForum

I am modifying theTMVAClassificationApplication.C with my own root file, and I get this:

warning: null passed to a callee that requires a non-null argument [-Wnonnull]
   std::cout << "--- TMVAClassificationApp    : Using input file: " << input->GetName() << std::endl;

I followed as accurate as possible the tutorial macro but I don’t see the error. Could you please give me a hand?

I attach the root file and the modified macros of classification and application TMVAClassification_socialfinal.C (17.5 KB)
TMVAClassificationApplication_socialfinal.C (22.1 KB)
Data_social_training.root (130.3 KB)

Thanks for your attention and have a nice day :slight_smile:


Hi Karen,

You don’t open your input file. (All the logic for that is commented out. Check lines 232 through 248.)

In general, warnings and errors usually indicate the position in the file were the warning/error occurs which can help debugging immensly!


Hello kialbert,

You were right, I only had to open my input file. I used

TFile* file = TFile::Open("xfile.root");

and it works, thanks a lot.


Glad to be of help Karen!

If you found a solution to your problem please mark the post that provided the it as such :slight_smile: