ROOT Version: 6.38.04 Platform: Windows Compiler: Visual Studio 2026 (18.3.3)
I cannot get the simplest thing to run. I want to use ROOT in my c++ app and without even writing any special code, just including “TGraphErrors.h” compiels but results in error c0000374 without specifying any of my code. The call stack is:
maybe this note is the problem: “You must download the binary built with the exact same version of Visual Studio (and Python) than the one installed on your system.“
since there is not visual studio 2026 binary?
I also tried the precompiled binaries of the latest stable release 6.26.10 with the same result.
#pragma once
#include "TGraphErrors.h"
#include <iostream>
int main() {
std::cout << "Hello World";
}
EDIT: The error disappears when I remove all .dll files from the exe folder. But the build output shows “The C++ standard in this build does not match ROOT configuration (201703L); this might cause unexpected issues. And please make sure you are using the -Zc:__cplusplus compilation flag“
OK, your CMakeLists.txt looks weird… It doesn’t show what you are trying to build (i.e. there is no add_executable nor add_library)
Here is a simple example:
Here, the important line is set(CMAKE_CXX_FLAGS "${ROOT_CXX_FLAGS}"), so you produce binary compatible code.
Otherwise, you have to manually specify the proper compiler flags. I.e.
I continued to try different things and started using the precompiled binaries. I saw that everything works just fine when I install root with the installer and let it add to the Path variable.
BUT: I will have to distribute my app to other systems and would like to not have to install root everywhere. So I was hoping I could just copy the necessary dlls into the exe folder. I used the dependency walker to see which dlls are linked on my developer machine und copied those into the exe folder on a different test system without root installed. This did not work and resulted in the afformentioned
Well, not really. ROOT needs not only its DLLs, but also its plugins, icons (pixmap), fonts, config files, and so on… All relative to %ROOTSYS%. And it also needs the MSVC runtime environment, to be able to find the C++ headers (for the JIT interpreter). Now, depending on what subset of libraries you need, one might find a solution, but it would require quite some time and effort to investigate what minimal set would be needed.