# Building and Executing ROOT6 on Windows with VS2019

**URL:** <https://root-forum.cern.ch/t/building-and-executing-root6-on-windows-with-vs2019/39864>\
**Category:** ROOT\
**Created:** [June 10, 2020, 2:56pm UTC](https://root-forum.cern.ch/t/building-and-executing-root6-on-windows-with-vs2019/39864 "2020-06-10T14:56:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoshimoto](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/yoshimoto/32/16764_2.png) [@yoshimoto](https://root-forum.cern.ch/u/yoshimoto)\
**Post date:** [June 10, 2020, 2:56pm UTC](https://root-forum.cern.ch/t/building-and-executing-root6-on-windows-with-vs2019/39864/1 "2020-06-10T14:56:20Z")

</div>

* * *

_ROOT Version:_ 6.20.04  
_Platform:_ Windows 10  
_Compiler:_ Visual Studio 2019 cl.exe

* * *

> [@Run ROOT 6.19.02 on Windows 10](https://root-forum.cern.ch/t/run-root-6-19-02-on-windows-10/38529/14):
>
> There are several topics you can find on this forum, for example: You need CMake (latest version), and then you can: Unzip the source tar file in a directory not containing any space Open a x86 Native Tools Command Prompt for VS 2019 !!!And NOT a x64 one!!! Create a build directory of your choice and cd into it Then configure ROOT with: cmake -G "Visual Studio 16 2019" -A Win32 -Thost=x64 -DCMAKE\_VERBOSE\_MAKEFILE=ON -DCMAKE\_CXX\_STANDARD=14 [path to source] Then, if there was no error, b…

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 build my new project in VS2019.

```auto
#include <TCanvas.h>
#include <TH1F.h>
#include <TF1.h>
#include <TROOT.h>
#include <TStyle.h>
using namespace std;

int main() {
//contents
}

```

> [@Includes error in VS2019 (RWrap\_libcpp\_string\_view.h)](https://root-forum.cern.ch/t/includes-error-in-vs2019-rwrap-libcpp-string-view-h/37702):
>
> Hi there, I am using Visual Studio 2019 and ROOT version 6.18/04. I recently installed Python development tools in VS which installed Python to my PC. However after doing this, my ROOT programs have stopped working and VS returns the errors: 1\>C:\root\include\ROOT\RWrap\_libcpp\_string\_view.h(429,34): error C2039: ‘\_\_find\_end’: is not a member of ‘std’ 1\>C:\root\include\ROOT\RWrap\_libcpp\_string\_view.h(125): message : see declaration of ‘std’ 1\>C:\root\include\ROOT\libcpp\_string\_view.h(193,9): …

As reported in above link, I also have the error.

```
1>C:\root\include\ROOT\RWrap_libcpp_string_view.h(429,34): error C2039: ‘__find_end’: is not a member of ‘std’

```

I replaced the sentence in root\_v6.20.04\include\ROOT\RWrap\_libcpp\_string\_view.h

from

```
  const _CharT* __r = _VSTD::__ find_end(

```

to

```
  const _CharT* __r = _VSTD::find_end(

```

, and then the build was successful and the exe ran correctly with appropriate PATH.

I would like to thank @bellenot for ROOT6 for Windows.

---

<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:** [June 10, 2020, 3:01pm UTC](https://root-forum.cern.ch/t/building-and-executing-root6-on-windows-with-vs2019/39864/2 "2020-06-10T15:01:42Z")

</div>

> [@yoshimoto](#):
>
> I would like to thank @bellenot for ROOT6 for Windows.

Thanks @yoshimoto san!  
And concerning the `RWrap_libcpp_string_view.h` issue, I’ll check what exactly is the issue. Thanks for the feedback!  
And note that the errors at start-up have been solved in the last 6.20.6 release, and will also be in the coming soon 6.22.0 release

---

<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:** [June 24, 2020, 3:01pm UTC](https://root-forum.cern.ch/t/building-and-executing-root6-on-windows-with-vs2019/39864/3 "2020-06-24T15:01:43Z")

</div>

Closed on June 24, 2020, 3:01pm UTC

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