_ROOT Version: 6.18.02
_Platform: Window 10 Home version 1903 x64-based processor Compiler: Not Provided
Visual Studio Community 2019 version 16.2.29215.179 installed
I am having similar issues as reported in the now closed topic
“Root 6.14.04 installation issues on Windows 10”
The installation of root 6.18.02 using the self-extraction *.exe file provided in the download page seems to proceed without a problem. But when one double clicks on the ROOT application a command-line window briefly opens, displays an error, then closes.
When ‘root’ is invoked on the command line by hand one can see this error:
RegOpenKeyEx(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\$VERSION\InstallationFolder): returned 2: The system cannot find the file specified.
RegOpenKeyEx(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10): returned 2: The system cannot find the file specified.
input_line_1:1:10: fatal error: 'new' file not found
#include <new>
^~~~~
Assertion failed: OldBuilder->DeferredDeclsToEmit.empty() && "Should have emitted all decls deferred to emit.", file C:\build\ws\BUILDTYPE\Release\LABEL\windows10\V\6-18\root\interpreter\llvm\src\tools\clang\lib\CodeGen\ModuleBuilder.cpp, line 139
I have looked at previous problems which appear similar to this and it appears this issue has never actually been resolved or fixed. I’d rather not have to compile the code from scratch on my PC but if that is required I would really appreciate instructions on what to do.
Prior to loading root 6.18.02 I already pre-loaded Visual Studio community 2019 (which seemed to load and run OK) so not having visual studio present does not seem to be the problem.
Is there someplace on this page where this is explained and also identifying exactly which version of Visual Studio is required? If not then I’d appreciate it if someone would let me know what version that is so that I can give it a try myself. Is it Visual Studio 16?
At the top of my original post I have the full version number of the version of Visual Studio I had installed before I tried to install root 6.18.02.
Way Hey!
It looks like I have a mostly successful result!
root does start now and it gives me a prompt, but there are quite a few errors that appear before It gets to this point.
Here is what happens when I invoke root 6.18.02 now that I seem to have loaded Visual Studio Community with the correct version of the Windows 10 SDK:
Microsoft Windows [Version 10.0.18362.295]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\Todd Huffman>root
In file included from input_line_3:39:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019NEW\VC\Tools\MSVC\14.22.27905\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\2019NEW\VC\Tools\MSVC\14.22.27905\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\2019NEW\VC\Tools\MSVC\14.22.27905\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\2019NEW\VC\Tools\MSVC\14.22.27905\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
^
------------------------------------------------------------
| Welcome to ROOT 6.18/02 https://root.cern |
| (c) 1995-2019, The ROOT Team |
| Built for win32 on Aug 23 2019, 20:56:50 |
| From tags/v6-18-02@v6-18-02 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------
root [0]
Are these errors of any concern? Is there any way that I can get them removed?
Cheers,
Todd
The Windows binaries per se do not require a specific compiler, it’s just that ROOT chooses to ship the pre-compiled header with the binaries, which leads to clashes. Specifically, macro names have changed between versions so you get those re-definitions b/c your local headers have different guards than the ones in the pre-compiled header.
To get around it, you need to wipe out the PCH (find it under %ROOTSYS%/etc, named allDict.cxx.pch), then rebuild it in the compiler dev environment in which you intend to use ROOT. Something like (assuming 32b here, and modulo typos):
You can also make use of the makepch.py script that is in %ROOTSYS%\etc\dictpch, which may be simpler (feed it allHeaders.h and allLinkDefs.h with the flags from allCppFlags.txt, all in %ROOTSYS%\etc\dictpch).
Note that this is not a Windows-only problem, just that ROOT has several hacks to make things work on most Linuxes (e.g. a few standard headers, such as wchar.h, are shipped with ROOT, find them under $ROOTSYS/etc/cling on Linux) and Mac is more conservative in its changes.
But really, ROOT should make the PCH creation part of the installation of the binaries instead of their build. Spread the word …
I will need some spare time to try this, and probably more time to understand it and get it to work.
I was kind of hoping to remain a blissfully ignorant ROOT user rather than to have to learn how to recompile it for my platform (which will, one day, encounter support issues once again when I will have forgotten any incantations that I learn now and require a different release or end up with another version of the OS).
As for your last sentence, we are certainly in agreement there.