Trouble installing root on Windows 10

I downloaded and installed the latest version of Visual Studio 2019 on my Windows 10 computer. I followed the few directions that I found here, and everything seemed very straightforward. With it I can compile and run simple code Then I grabbed a very recent pre-compiled version of root that appears to have been compiled with the same compiler. When I run root, I get this:

Z:\My Documents\root-play>root -l
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.21.27702\\include\cassert:5:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\assert.h:12:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.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.21.27702\\include\cassert:5:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\assert.h:12:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:516:16: error: redefinition of '__crt_locale_data_public'
typedef struct __crt_locale_data_public
               ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\crtdefs.h:10:10: note: 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h' included multiple times, additional include
      site here
#include <corecrt.h>
         ^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\assert.h:12:10: note: 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h' included multiple times, additional include
      site here
#include <corecrt.h>
         ^
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.21.27702\\include\cassert:5:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\assert.h:12:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:523:16: error: redefinition of '__crt_locale_pointers'
typedef struct __crt_locale_pointers
               ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\crtdefs.h:10:10: note: 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h' included multiple times, additional include
      site here
#include <corecrt.h>
         ^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\assert.h:12:10: note: 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h' included multiple times, additional include
      site here
#include <corecrt.h>
         ^
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.21.27702\\include\cassert:5:
In file included from C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\assert.h:12:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h:531:16: error: redefinition of '_Mbstatet'
typedef struct _Mbstatet
               ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\crtdefs.h:10:10: note: 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h' included multiple times, additional include
      site here
#include <corecrt.h>
         ^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\assert.h:12:10: note: 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt\corecrt.h' included multiple times, additional include
      site here
#include <corecrt.h>
         ^
root [0]

Nasty, but it is working. Back with Visual Studio 2013 and root 5.34.14, I didn’t get any errors. I get these errors whether i open a “Visual Studio developer” window or a plain window.

Then I tried compiling code from within root using the “Visual Studio developer” DOS window. It’s the simple slits.cpp program that is found in the tutorial. Without the “+” at the end, it works fine, but with the “+” I get:

root [0] .L slits.cpp+
Info in <TWinNTSystem::ACLiC>: creating shared library Z:/My Documents/root-play/slits_cpp.dll
slits_cpp_ACLiC_dict.cxx
   Creating library Z:/My Documents/root-play\slits_cpp.lib and object Z:/My Documents/root-play\slits_cpp.exp
LINK : fatal error LNK1181: cannot open input file 'VCRUNTIME140.lib'
Error in <ACLiC>: Compilation failed!
root [1]

This too worked back with VS 2013 and root 5.34.14 without any errors. I’ve tried all kinds of things like downloading a different version of root or adding some older stuff to my Visual Studio distribution, e.g., an older SDK, but nothing gets rid of these errors. I’ve scoured the internet looking for a solution, but I haven’t found one. I’d rather not resort to downloading VS 2013 and root 5.34.14 on my brand new computer.

I did trying building root from the ground floor up, but that didn’t work either. I used cmake and some instructions that I gleaned from the forum here, but it complains about missing file pthread.h and one other thing and then dies.

Thank you for any help you can provide.


_ROOT Version: Release 6.18/00 - 2019-06-25
_Platform: Windows 10
_Compiler: Visual Studio 2019


I also had problems installing ROOT on Windows 10. This is the topic I had. You could try some of the suggestions there, like making sure you installed Visual Studio with “Desktop development with C++”.
I eventually ended up installing ROOT in Ubuntu for Windows, and I described my process at the above link.

Thanks! I did go with “Desktop development with C++”. I just looked at your post (for about the third time since yesterday, but this time I read it carefully). That could be a way to go. I’m not familiar with Ubuntu.

Using Ubuntu for Windows is kind of annoying. You have to type export DISPLAY=:0 into the terminal every time you open it for ROOT to work, and not all graphical applications will run.
However, it’s good enough for me. I use the built-in program Nano to code, and I’m able to view the graphs I create. After spending three days trying to install ROOT, I was just happy to have something that worked.

Wow! The whole thing is kinda cool @Jabberspocky (I feel like a kid in a candy store). I haven’t used linux-style systems much, but that Ubuntu installs easily, and it prompts you when you type something that doesn’t work. I’m having all kinds of fun playing with it (and XMING). Your post is GREAT. I haven’t tried root again, but I probably will soon. I can see how it would work (it being linux and all). I will miss coding in Visual Studio with root. Its IDE is so good–I have a hard time believing Ubuntu offers something similar.

2 Likes

Visual Studio’s Code is available for Linux: https://code.visualstudio.com/download

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