For whatever reason some ROOT classes, such as TCanvas and TFile, will work if and only if I include the Garfield++ toolkit when building the executables. Other classes such as TTree just won’t work no matter what I do.
I’ve already tried a pre-compiled binary, also to no sucess. I’m quite new to the ROOT framework and CMake and just can’t seem to find the problem. I’ll be glad to provide more information if needed.
ROOT Version: 6.32.2 Platform: Ubuntu 24.04 Compiler: GNU 12.4.0
Thanks for the post and welcome to the ROOT Community!
Sorry to read ROOT does not work out of the box in your setup.
The fact you can build the simple program and run it ok is reassuring: it means ROOT works.
About CMake, are you sure you are using there the same ROOT you used for the simple executable? There could be something wrong with your setup: it looks some debugging is needed on your side.
For anything Garfield related, I am adding @hschindl
I was able to solve the problem after installing the pre-compiled binary again. I read here that CMake was supposed to find the ROOT package from Conda automatically, but for whatever reason that wasn’t happening.
After deactivating the Conda environment and installing the binary again, I was finally able to link the ROOT classes to my project using CMake.
I don’t know why the binary distribution worked the 2nd time. I might’ve forgotten to deactivate the Conda env the 1st time, or I didn’t properly link the package using CMake. Either way, I appreciate your attention.