Can't run a root tutorial

Hello, I am using windows 8 and I recently downloaded root version 5.34.20, MSI package.
Wenn I tried to open a root tutorial by typing

.x $ROOTSYS/tutorials/hsum.C+

I got the following error message:

[color=#800000]‘cl.exe’ is not recognized as an internal or external command, operable program or batch file.
Error: external preprocessing failed. (0)
Error: C:\root\bin\rootcint: error loading headers…
Error in : Dictionary generation failed!
Info in : Invoking compiler to check macro’s validity
Error: Function hsum() is not defined in current scope (0) [/color]

I am new to root and don’t understand what this error message means. I would appreciate any help or advice.

Another question: I am having a .cpp file and a .h file. How to execute them with root?


You need Visual C++ to be able to compile a macro using ACLiC. If you don’t have it, you can still execute (interpret) the macro by simply typing:

.x $ROOTSYS/tutorials/hsum.C

And if you have Visual C++ installed, you have to start a “Developer Command Prompt for VS2012” from the Windows Menu, or, from the command prompt, you can start:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\VsDevCmd.bat

(Those are example for Visual Studio 2012)

Well, it depends on the code which is inside those files…

Cheers, Bertrand.