Hi all,
I’m a summerstudent working on an existing code (C++) with Qt Creator. The goal is to embed a ROOT canvas within the Qt created application/program. There are two examples (similar to each other) that I’ve tried: qtcanvas from Github and qtcanvas from Gitlab.
If anyone experienced with ROOT and/or Qt knows what is breaking, or knows an alternative way implement ROOT in a QtWidget: your expertize would be greatly appreciated.
Both examples produce the following errors during compilation:
TCanvas.h: No such file or directory qtcanvas.hpp 13
TApplication.h: No such file or directory main.cpp 10
I’ve installed ROOT in /usr/local/ and used $ source /usr/local/root/bin/thisroot.h. ROOT works on terminal and the headers and libraries are in place. I’ve tried different versions of Qt and different compilers; they produce the same error.
I’ve managed to solve this bug for the older version of qtcanvas (github), by adding the following lines to CMakeList.txt:
find_package(ROOT REQUIRED)
include(${ROOT_USE_FILE})
This produced 62 errors concerning TString.h , for example:
'string_view' in namespace 'std' does not name a type TString.h 291
expected type-specifier TString.h 118
An example of compile output:
/usr/local/root/include/RConfigure.h:30:4: warning: #warning is a GCC extension
30 | # warning "The C++ standard in this build does not match ROOT configuration (201703L); this might cause unexpected issues"
| ^~~~~~~
/usr/local/root/include/RConfigure.h:30:4: warning: #warning "The C++ standard in this build does not match ROOT configuration (201703L); this might cause unexpected issues" [-Wcpp]
Thank you in advance,
Andrej
ROOT Version: v6.28/04
Platform: Ubuntu v22.04
Compiler: GCC v11.3.0, Clang14 and MinGW
Qt Version: Qt v5.15.2 and v6.2.4





