Hi all:
I’m building root and trying to use ROOT with my C++ code. I’m using a x64 windows 10 computer, and gcc 12.2.0. The ROOT version is the latest one on the website and I’ve tried to download the .exe/.tar binary distribution but showed the same error. I extracted the tar file/looked for the installed folder and source thisroot.h plus running thisroot.bat. Then when I was trying to run ‘root-config’ command, it showed the following error. As I’m pretty new to C++ coding and ROOT, I was wondering if anyone know why this error happens and how to resolve this.
Thanks.
I’ve attached the error screenshot and the makefile as a reference.
ROOT is not supported with MingW/gcc. Please use the native binaries on Windows with Visual Studio, or use WSL (Windows Subsystem for Linux)
what’s the native binaries with VS?
I’m using vs 2022 x64, are you saying to compile with VS itself? Is it possible to compile a cpp file with ROOT framework? (as I’m trying to use ROOT as part of my other c++ code)
Also I wanna mention that I could successfully start root in powershell after sourcing and calling .bat file, but I wish it to be incorporated in a cpp file that I could compile.
Well, yes, ROOT is not a compiler, it uses the system compiler.
Absolutely! See the examples in the ${ROOTSYS}/test directory
And you should start from ROOT Manual - Basics - ROOT, you will probably find the answer to your questions