# ROOT C++ in Windows

**URL:** <https://root-forum.cern.ch/t/root-c-in-windows/59332>\
**Category:** Newbie\
**Created:** [May 14, 2024, 10:39am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332 "2024-05-14T10:39:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_P\_abhisek](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/a_p_abhisek/32/34049_2.png) [@A\_P\_abhisek](https://root-forum.cern.ch/u/A_P_abhisek)\
**Post date:** [May 14, 2024, 10:39am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/1 "2024-05-14T10:39:07Z")

</div>

I want to run cern root in windows without using wsl or virtual box, I want to use it using visual studio code.

---

<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:** [May 14, 2024, 10:42am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/2 "2024-05-14T10:42:34Z")

</div>

Then you can download a pre-built release from the ROOT web page, e.g. [Release 63006 - ROOT](https://root.cern/releases/release-63006/)  
And you also have to install Visual Studio 2022 (Community is free), with the Desktop development with C++

---

<div class="post-metadata">

**Author:** ![A\_P\_abhisek](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/a_p_abhisek/32/34049_2.png) [@A\_P\_abhisek](https://root-forum.cern.ch/u/A_P_abhisek)\
**Post date:** [May 14, 2024, 10:44am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/3 "2024-05-14T10:44:46Z")

</div>

Ok, I tried once as stated by the cern root website but there are some errors I am getting like unable to find the visual studio code.

I am a complete newbie in this windows environment, Could you please help, me?

---

<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:** [May 14, 2024, 10:46am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/4 "2024-05-14T10:46:03Z")

</div>

Visual Studio Code is not part of ROOT. You have to install it from [https://code.visualstudio.com/](https://code.visualstudio.com/)

---

<div class="post-metadata">

**Author:** ![A\_P\_abhisek](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/a_p_abhisek/32/34049_2.png) [@A\_P\_abhisek](https://root-forum.cern.ch/u/A_P_abhisek)\
**Post date:** [May 14, 2024, 10:46am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/5 "2024-05-14T10:46:49Z")

</div>

Ok, I have downloaded it, and currently installing it.

---

<div class="post-metadata">

**Author:** ![A\_P\_abhisek](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/a_p_abhisek/32/34049_2.png) [@A\_P\_abhisek](https://root-forum.cern.ch/u/A_P_abhisek)\
**Post date:** [May 14, 2024, 10:47am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/6 "2024-05-14T10:47:42Z")

</div>

What should I do next?

---

<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:** [May 14, 2024, 10:49am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/7 "2024-05-14T10:49:06Z")

</div>

Well, I don’t know, what do you want to achieve? Did you try [Get Started - ROOT](https://root.cern/get_started/) and [ROOT Primer - ROOT](https://root.cern/primer/) ? I would suggest to start from there

---

<div class="post-metadata">

**Author:** ![A\_P\_abhisek](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/a_p_abhisek/32/34049_2.png) [@A\_P\_abhisek](https://root-forum.cern.ch/u/A_P_abhisek)\
**Post date:** [May 14, 2024, 10:51am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/8 "2024-05-14T10:51:57Z")

</div>

well, I want to install root in windows and work in it, as people install it in different os like linux and all  
and use it.

---

<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:** [May 14, 2024, 11:00am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/9 "2024-05-14T11:00:05Z")

</div>

Then as I said, just follow [Get Started - ROOT](https://root.cern/get_started/) and in particular [ROOT Primer - ROOT](https://root.cern/primer/)  
To start ROOT, once you installed it, open a `Developer Command Prompt for VS 2022`, then assuming you installed ROOT in `C:\root`, call (type) `C:\root\bin\thisroot.bat` and then you can start ROOT. For example:

```cmd
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.9.6
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************

C:\root-dev>C:\root\bin\thisroot.bat

C:\root-dev>root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.30/06 https://root.cern |
  | (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for win64 on Apr 03 2024, 06:35:12 |
  | From tags/v6.30.06-0-g4f4e716372@v6.30.06-0-g4f4e716372 |
  | With MSVC 19.39.33521.0 |
  | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

root [0]

```

---

<div class="post-metadata">

**Author:** ![A\_P\_abhisek](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/a_p_abhisek/32/34049_2.png) [@A\_P\_abhisek](https://root-forum.cern.ch/u/A_P_abhisek)\
**Post date:** [May 14, 2024, 11:01am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/10 "2024-05-14T11:01:59Z")

</div>

I tried this at the end it says “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   
^ ~~~~  
Assertion failed: OldBuilder-\>DeferredDeclsToEmit.empty() && “Should have emitted all decls deferred to emit.”, file C:\ROOT-CI\src\interpreter\llvm-project\clang\lib\CodeGen\ModuleBuilder.cpp, line 155”

---

<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:** [May 14, 2024, 11:05am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/11 "2024-05-14T11:05:13Z")

</div>

Did you install `Visual Studio (2022)`? (NOT the `Visual Studio Code` editor)

---

<div class="post-metadata">

**Author:** ![A\_P\_abhisek](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/a_p_abhisek/32/34049_2.png) [@A\_P\_abhisek](https://root-forum.cern.ch/u/A_P_abhisek)\
**Post date:** [May 14, 2024, 11:06am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/12 "2024-05-14T11:06:32Z")

</div>

yes tried with that the community version

---

<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:** [May 14, 2024, 11:08am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/13 "2024-05-14T11:08:33Z")

</div>

And you started from a `Developer Command Prompt for VS 2022`? Can you copy and paste the whole session, as I did in the example?

---

<div class="post-metadata">

**Author:** ![A\_P\_abhisek](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/a_p_abhisek/32/34049_2.png) [@A\_P\_abhisek](https://root-forum.cern.ch/u/A_P_abhisek)\
**Post date:** [May 14, 2024, 11:09am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/14 "2024-05-14T11:09:04Z")

</div>

OK checking it!

---

<div class="post-metadata">

**Author:** ![A\_P\_abhisek](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/a_p_abhisek/32/34049_2.png) [@A\_P\_abhisek](https://root-forum.cern.ch/u/A_P_abhisek)\
**Post date:** [May 14, 2024, 11:22am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/15 "2024-05-14T11:22:39Z")

</div>

Following Steps I have done now:

1. Downloaded root( [root\_v6.30.06.win64.vc17.zip](https://root.cern/download/root_v6.30.06.win64.vc17.zip) 172M) from here: [Release 53436 - ROOT](https://root.cern/releases/release-53436/#windows)

2. Installed VIsual Studio Code community

3. Opened the Developer command prompt for vs 2022

4 run this line to get to username directory:

```auto
cd %USERPROFILE%

```

5 run this line for final installation:c:\root\bin\thisroot.bat

I am getting this:The system cannot find the path specified.

---

<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:** [May 14, 2024, 11:29am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/16 "2024-05-14T11:29:35Z")

</div>

Where did you install (unzipped) ROOT?

---

<div class="post-metadata">

**Author:** ![A\_P\_abhisek](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/a_p_abhisek/32/34049_2.png) [@A\_P\_abhisek](https://root-forum.cern.ch/u/A_P_abhisek)\
**Post date:** [May 14, 2024, 11:30am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/17 "2024-05-14T11:30:45Z")

</div>

under the username directory, “abhis”

---

<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:** [May 14, 2024, 11:34am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/18 "2024-05-14T11:34:38Z")

</div>

Then from your `abhis` user directory, call `root\bin\thisroot.bat`

---

<div class="post-metadata">

**Author:** ![A\_P\_abhisek](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/a_p_abhisek/32/34049_2.png) [@A\_P\_abhisek](https://root-forum.cern.ch/u/A_P_abhisek)\
**Post date:** [May 14, 2024, 11:38am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/19 "2024-05-14T11:38:35Z")

</div>

so this batch file is under bin directory, under root directory, under abhis directory.

so my code" **“c:\root\bin\thisroot.bat”** was correct right?

C:\Users\abhis\>c:\root\bin\thisroot.bat

---

<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:** [May 14, 2024, 11:40am UTC](https://root-forum.cern.ch/t/root-c-in-windows/59332/20 "2024-05-14T11:40:21Z")

</div>

No, as I said, it should be: `C:\Users\abhis>root\bin\thisroot.bat`

[Next page](https://root-forum.cern.ch/t/root-c-in-windows/59332.md?page=2)
