# Building root on windows 10 again

**URL:** <https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895>\
**Category:** ROOT\
**Created:** [October 18, 2020, 9:04am UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895 "2020-10-18T09:04:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bogomyag](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/e0b2c6/32.png) [@bogomyag](https://root-forum.cern.ch/u/bogomyag)\
**Post date:** [October 18, 2020, 9:04am UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895/1 "2020-10-18T09:04:08Z")

</div>

* * *

_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

\_ROOT Version: 6.22.02  
\_Platform: Windows 10  
\_Compiler: Visual Studio Community 2019  
16.7.6

* * *

Hello, ROOT community,

I tried to build rood after reading

> [@Building ROOT on windows 10](https://root-forum.cern.ch/t/building-root-on-windows-10/40602):
>
> Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293) \_ROOT Version: ROOT 6.22 \_Platform:Windows 10 \_Compiler:Visual studio 2019 Dear ROOT community: When I was building ROOT, the following error occurred: D:/Program\_Files/Visual Studio 2019/MSBuild/Microsoft/VC/v160/Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited; code -1073741515). [D:/root\_build/hsimple.vcxproj] Can you tell me how to solve this problem?

> [@Run ROOT 6.19.02 on Windows 10](https://root-forum.cern.ch/t/run-root-6-19-02-on-windows-10/38529/12):
>
> I installed Windows SDK version 10.0.18362.1 and ROOT 6.20.02 works without any problem.

> [@Building and Executing ROOT6 on Windows with VS2019](https://root-forum.cern.ch/t/building-and-executing-root6-on-windows-with-vs2019/39864):
>
> ROOT Version: 6.20.04 Platform: Windows 10 Compiler: Visual Studio 2019 cl.exe In reference to the link above, after a additional step, I successfully built ROOT6 in Windows with VS2019!!. The additional step is that converting all source files to UTF-8 with BOM. Since my environment is Japanese, I had a compiling error regarding the character code. In the Japanese environment, all character codes except ASCII and UTF-8 with BOM are interpreted as Shift-JIS. Then I tried to create and …

and was unsuccessful.

I started x86 Native Tools Command Prompt for VS 2019, created and changed to  
`D:\root-6.22.02-build`

`cmake -G "Visual Studio 16 2019" -A Win32 -Thost=x64 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_CXX_STANDARD=14 -Droofit=ON -Dfftw3=ON -DFFTW_INCLUDE_DIR=D:\fftw -DFFTW_LIBRARY=D:\fftw\libfftw3-3.lib D:\root-6.22.02-source > ..\cmake-output-1-22.02.txt`  
The output is here[cmake-output-1-22.02.txt](https://root-forum.cern.ch/uploads/short-url/o01ZKcHE3U2ymWUFe9MbLMgSXua.txt) (10.1 KB)  
Everything is configured and generated well.

Then, I do  
` cmake --build . --config Release -- /maxcpucount > ..\cmake-build-1-22.02.txt`  
[cmake-build-1-22.02.txt](https://root-forum.cern.ch/uploads/short-url/vvN9XCnU5jUyd8IrFYTxdM9Bh1z.txt) (1.4 MB)  
There are 6 errors:

```auto
         C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility(137,9): error G08EB1F86: expected member name or ';' after declaration specifiers [D:\root-6.22.02-build\core\G__Core.vcxproj]
         C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility(137,9): error GC66A3811: expected ')' [D:\root-6.22.02-build\core\G__Core.vcxproj]
         C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility(218,24): error G08EB1F86: expected member name or ';' after declaration specifiers [D:\root-6.22.02-build\core\G__Core.vcxproj]
         C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility(218,24): error GC66A3811: expected ')' [D:\root-6.22.02-build\core\G__Core.vcxproj]
         C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xutility(63,31): error G959205E0: '_To' does not refer to a value [D:\root-6.22.02-build\core\G__Core.vcxproj]
         CUSTOMBUILD : error : Error loading the default header files. [D:\root-6.22.02-build\core\G__Core.vcxproj]

```

I tried to convert  
D:\root-6.22.02-source\graf2d\win32gdk\gdk\src\glib\gunichartables.h to UTF 8 with BOM  
configure and build again, and I have got the same 6 errors.  
Here are the output of configure and build  
[cmake-output-1-22.02.txt](https://root-forum.cern.ch/uploads/short-url/o01ZKcHE3U2ymWUFe9MbLMgSXua.txt) (10.1 KB) [cmake-build-2-22.02.txt](https://root-forum.cern.ch/uploads/short-url/i6Koi9mQtxmQoZWdDRsFqA2CVLf.txt) (1.4 MB)

Could you help me solve the problem?  
Anton

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [October 19, 2020, 7:00am UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895/2 "2020-10-19T07:00:16Z")

</div>

Hi,

Unfortunately ROOT v6.22 cannot be built with the latest version of Visual Studio. Please try the master, or wait until the v6.22 gets fixed (if it gets fixed…)  
You can also try to add those lines in `interpreter/cling/lib/Interpreter/CIFactory.cpp`, at line 766, as shown in this diff:

```auto
diff --git a/interpreter/cling/lib/Interpreter/CIFactory.cpp b/interpreter/cling/lib/Interpreter/CIFactory.cppindex 3e623a8d99..8d08a1bbda 100644
--- a/interpreter/cling/lib/Interpreter/CIFactory.cpp
+++ b/interpreter/cling/lib/Interpreter/CIFactory.cpp
@@ -763,6 +763,12 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
     PPOpts.addMacroDef(" __CLING__ GNUC_MINOR__=" ClingStringify(__GNUC_MINOR__));
 #elif defined(_MSC_VER)
     PPOpts.addMacroDef(" __CLING__ MSVC__=" ClingStringify(_MSC_VER));
+#if (_MSC_VER >= 1926)
+ // FIXME: Silly workaround for cling not being able to parse the STL
+ // headers anymore after the update of Visual Studio v16.7.0
+ // To be checked/removed after the upgrade of LLVM & Clang
+ PPOpts.addMacroDef(" __CUDACC__");
+#endif
 #endif

 // https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html

```

Cheers, Bertrand.

---

<div class="post-metadata">

**Author:** ![bogomyag](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/e0b2c6/32.png) [@bogomyag](https://root-forum.cern.ch/u/bogomyag)\
**Post date:** [October 19, 2020, 10:04am UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895/3 "2020-10-19T10:04:51Z")

</div>

Thank you Bertrand,

I tried adding the lines you proposed, now there are only two errors

```auto
         CUSTOMBUILD : error : D:/root-6.22.02-build/bin/rootcling.exe: compilation failure (D:/root-6.22.02-build/bin/libROOTVecOps7571783666_dictUmbrella.h) [D:\root-6.22.02-build\math\vecops\G__ROOTVecOps.vcxproj]
'''
[cmake-build-4-22.02.txt|attachment](upload://vklIWD51wbPMqdtMjFfCjliffBg.txt) (2.0 MB) 
Anton
```

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [October 19, 2020, 10:06am UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895/4 "2020-10-19T10:06:00Z")

</div>

Add `#include <tuple>` in `math\vecops\inc\ROOT\RVec.hxx`  
BTW, FYI, those errors should be fixed in the next versions of ROOT

---

<div class="post-metadata">

**Author:** ![pamputt](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pamputt/32/12526_2.png) [@pamputt](https://root-forum.cern.ch/u/pamputt)\
**Post date:** [October 19, 2020, 1:23pm UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895/5 "2020-10-19T13:23:02Z")

</div>

Would it be possible to ass all this information on [https://root.cern/install/build\_from\_source/](https://root.cern/install/build_from_source/) ? Currently, we could think that it is possible to compile ROOT on Windows 10 when not.

I think it would be good this page be updated with the latest information concerning Windows 10 (32-bit compilation only, which build options work or not, etc).

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [October 19, 2020, 1:24pm UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895/6 "2020-10-19T13:24:38Z")

</div>

> [@pamputt](#):
>
> Would it be possible to ass all this information on [Building ROOT from source - ROOT](https://root.cern/install/build_from_source/) ? Currently, we could think that it is possible to compile ROOT on Windows 10 when not.

Well, this was 6.22 only and will most probably be fixed today… I.e. master always compiles with the latest version of Visual Studio

> [@pamputt](#):
>
> I think it would be good this page be updated with the latest information concerning Windows 10 (32-bit compilation only, which build options work or not, etc).

Will do.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [October 19, 2020, 1:39pm UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895/7 "2020-10-19T13:39:34Z")

</div>

A [github issue](https://github.com/root-project/web/issues/449) has just been created

---

<div class="post-metadata">

**Author:** ![bogomyag](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/e0b2c6/32.png) [@bogomyag](https://root-forum.cern.ch/u/bogomyag)\
**Post date:** [October 19, 2020, 2:14pm UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895/8 "2020-10-19T14:14:46Z")

</div>

Thank you Bertrand, It compiled without errors. I will test it tomorrow.  
By the way, how to get the master?  
I tried the prebuilt exe, ACLIC does not work and I need FFTW…

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [October 19, 2020, 2:19pm UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895/9 "2020-10-19T14:19:45Z")

</div>

> [@bogomyag](#):
>
> By the way, how to get the master?

With git, from github. For example: `git clone https://github.com/root-project/root.git root_src`

---

<div class="post-metadata">

**Author:** ![bogomyag](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/e0b2c6/32.png) [@bogomyag](https://root-forum.cern.ch/u/bogomyag)\
**Post date:** [October 20, 2020, 5:24am UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895/10 "2020-10-20T05:24:19Z")

</div>

Bertrand,  
When I tried to build the master I got an error

```auto
CUSTOMBUILD : CMake error : Cannot restore timestamp D:/root-build/interpreter/llvm/src/tools/clang/include/clang/AST/CMakeFiles/generate.stamp [D:\root-build\interpreter\llvm\src\tools\clang\include\clang\AST\ClangAttrDump.vcxproj]

```

But the tar source was built without errors and ACLIC, FFT work.

However, when I ran the tutorials through demos.C after quitting root there is an errors message

````auto
D:\Users\avbog\Work\RootTutorials>root -l D:\root-6.22.02-build\tutorials\demos.C
root [0]
Processing D:\root-6.22.02-build\tutorials\demos.C...
root [1] .q
Assertion failed: content[posOpenCurly] == '{' && "No curly at claimed position of opening curly!", file D:\root-6.22.02-source\interpreter\cling\lib\MetaProcessor\MetaProcessor.cpp, line 431```
````

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [October 20, 2020, 6:22am UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895/11 "2020-10-20T06:22:46Z")

</div>

> [@bogomyag](#):
>
> When I tried to build the master I got an error
> 
> ```auto
> CUSTOMBUILD : CMake error : Cannot restore timestamp D:/root-build/interpreter/llvm/src/tools/clang/include/clang/AST/CMakeFiles/generate.stamp [D:\root-build\interpreter\llvm\src\tools\clang\include\clang\AST\ClangAttrDump.vcxproj]
> 
> ```

Never seen this error… Try to delete the file and re-build

> [@bogomyag](#):
>
> But the tar source was built without errors and ACLIC, FFT work.

Good! Then you can use this one I suppose

> [@bogomyag](#):
>
> However, when I ran the tutorials through demos.C after quitting root there is an errors message
> 
> ```auto
> D:\Users\avbog\Work\RootTutorials>root -l D:\root-6.22.02-build\tutorials\demos.C
> root [0]
> Processing D:\root-6.22.02-build\tutorials\demos.C...
> root [1] .q
> Assertion failed: content[posOpenCurly] == '{' && "No curly at claimed position of opening curly!", file D:\root-6.22.02-source\interpreter\cling\lib\MetaProcessor\MetaProcessor.cpp, line 431
> 
> ```

Yes, this `Assertion failed: content[posOpenCurly]` message is a known issue, but we couldn’t find what the problem is so far

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [November 3, 2020, 6:22am UTC](https://root-forum.cern.ch/t/building-root-on-windows-10-again/41895/12 "2020-11-03T06:22:48Z")

</div>

Closed on November 3, 2020, 6:22am UTC

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