Error when running root in Windows Command Prompt

Whenever I run root from the Command Prompt in Windows 10, I get the following the errors:

In file included from input_line_3:39:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\cassert:5:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\assert.h:12:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt.h:142:12: error: redefinition of ‘_CrtEnableIf<true, _Ty>’
struct _CrtEnableIf<true, _Ty>
^~~~~~~~~~~~~~~~~~~~~~~
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:142:12: note: previous definition is here
struct _CrtEnableIf<true, _Ty>
^
In file included from input_line_3:39:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\cassert:5:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\assert.h:12:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt.h:517:16: error: redefinition of ‘__crt_locale_data_public’
typedef struct __crt_locale_data_public
^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:516:16: note: previous definition is here
typedef struct __crt_locale_data_public
^
In file included from input_line_3:39:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\cassert:5:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\assert.h:12:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt.h:524:16: error: redefinition of ‘__crt_locale_pointers’
typedef struct __crt_locale_pointers
^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:523:16: note: previous definition is here
typedef struct __crt_locale_pointers
^
In file included from input_line_3:39:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include\cassert:5:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\assert.h:12:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt.h:532:16: error: redefinition of ‘_Mbstatet’
typedef struct _Mbstatet
^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:531:16: note: previous definition is here
typedef struct _Mbstatet

I am using root version Release 6.18/02. I am also using Visual Studio 2019.

After getting these errors, I am still able do a few simple commands using root like cout<<“Hello World”<<endl; .

Hi,

This is a known issue, when one is using a different version of the Windows Kit than the one used when building ROOT (10.0.17763.0 vs 10.0.18362.0). We will try to find a solution

Cheers, Bertrand.

Should I continue using this version of the root then?

Yes, if it works… Otherwise you can try to build ROOT from source with your own version of Visual Studio…