Hello,
I’m trying to use some ROOT classes but to no sucess. I’m using the conda-forge package.
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.
With the following CMakeLists.txt:
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(test)
find_package(Garfield REQUIRED)
add_executable(test test.cpp)
target_link_libraries(test Garfield::Garfield)
}
I can execute the following code without any problems:
#include <cstdlib>
#include <TROOT.h>
#include <TFile.h>
int main(int argc, char* argv[]){
TFile f("test.root", "new");
return 0;
}
But the following CMakeLists.txt:
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(test)
add_executable(test test.cpp)
}
Triggers the following error when building the executable:
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