Invalid architecture

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.
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?

The ones available for Windows from here: Installing ROOT - ROOT, for example, from the latest 6.28/04 release: you can choose between the Windows Visual Studio 2022 32-bit x86, or Windows Visual Studio 2022 64-bit x64

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

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.