ROOT C++ in Windows

Sorry for making this hard and taking your time,

here what I am getting:
C:\Users\abhis>\root\bin\thisroot.bat
The system cannot find the path specified.

You have an extra backslash in your command. It should be root\bin\thisroot.bat instead of \root\bin\thisroot.bat.

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

ok it ran succesfully

1 Like

now while running root, it says “‘root’ is not recognized as an internal or external command,
operable program or batch file.”

Did you type root after root\bin\thisroot.bat in the same Developer command prompt for vs 2022 session? Probably not…

yes, I did that

Can you copy and paste the whole session, like I did before, so I can see what you’re doing?

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

C:\Users\abhis>root
‘root’ is not recognized as an internal or external command,
operable program or batch file.

C:\Users\abhis>

OK, can you copy and paste the output of dir root\bin\*.exe

C:\Users\abhis>root\bin*.exe
The system cannot find the path specified.

C:\Users\abhis>dir root\bin*.exe
Volume in drive C has no label.
Volume Serial Number is 765F-C99C

Directory of C:\Users\abhis\root\bin

04/03/2024 12:36 PM 41,472 bindexplib.exe
04/03/2024 12:24 PM 13,312 genreflex.exe
04/03/2024 12:37 PM 56,320 hadd.exe
04/03/2024 12:37 PM 19,968 proofserv.exe
04/03/2024 12:37 PM 46,080 rmkdepend.exe
04/03/2024 12:35 PM 17,920 root.exe
04/03/2024 12:24 PM 13,312 rootcint.exe
04/03/2024 12:24 PM 13,312 rootcling.exe
04/03/2024 12:37 PM 54,272 rootnb.exe
04/03/2024 12:37 PM 113,664 rootreadspeed.exe
10 File(s) 389,632 bytes
0 Dir(s) 70,306,627,584 bytes free

Weird… Then can you start root like this: root\bin\root.exe

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

Still from the Developer command prompt for vs 2022 session? Then I suppose you didn’t install the Desktop development with C++ from the Visual Studio Installer?

how to do that

From the Visual Studio Installer:

done! Now where to use this root permanently.

You can add a new ROOTSYS environment variable pointing to the location of ROOT (in your case C:\Users\abhis\root) and add %ROOTSYS%\bin in your PATH. If you don’t know how to do this, look for Environment variables in the Windows Settings

yeah I know environment variable setting in windows, Now I will add the path C:\Users\abhis\root as the name root., then what to do!

No, please follow exactly what I said

Then you should be able to start ROOT from any Developer command prompt for vs 2022 session