Install Root - cl.exe

Hello,

I have problems to install root on my computer. I take the version for Windows (VC++ 9, MSI, Release version). The installation works an I can open it. There is a start screen and it’s possible to type commands. To test it I start a macro, for example fileopen.C and it works. Then I put in this directory (C:\root\macros) a file and start it with the command: .L chn2hist.C+
But the result is something I do not understand:

Info in TwinNTSystem::ACLiC: creating shared library C:\root\macros\chn2hist.dll
Der Befehl “cl.exe” ist entweder falsch geschrieben oder konnte nicht gefunden werden.
Errot: external preprocessing failed. (0)
!!!Removing C:\root\macros\chn2hist_C_ACLiC_dict.cxx C:\root\macros\chn2histCLiC_dict.h !!!
Error: C:\root\bin\rootcint: error loading headers…
Error in : Dictionary generation failed!
Info in : Invoking compiler to check macro’s validity

There is a german sentence. In english it’s something like that: The “cl.exe” command is written either incorrect or could not be found.

What I have to do?

Thanks

Hi,

If you add a + at the end of the macro name, that means you ask ROOT to compile the macro (by using the local compiler). So if you have Visual Studio installed on your computer, you should start root from a Visual Studio command prompt. If you don’t have any, you can still use ROOT, but if you really want to compile your macros, you will need to install a version of Visual Studio which is the same than the one used to build ROOT itself.

Cheers, Bertrand.

I have Microsoft Visual Studio Express 2013 for Windows Desktop. Is it OK?
And another stupid question: How can I start root from a “Visual Studio command prompt”. Sorry, I am an absolute newbie and a dead loss in root.

[quote=“RootRootRoot”]I have Microsoft Visual Studio Express 2013 for Windows Desktop. Is it OK?[/quote]No, as I said, you need the same version than the one used to build ROOT itself (latest available one is 2010, and you downloaded the 2008).

[quote=“RootRootRoot”]And another stupid question: How can I start root from a “Visual Studio command prompt”.[/quote]Simply open it from the Visual Studio menu (from the Windows main menu)…

Thanks for the help.
OK, I installed the Version (VC++ 10, Release, MSI) of root and Microsoft Visual Studio 2010. And I tried it again (but in Microsoft Visual Studio prompt) and that’s what I got:

[code]Setting environment for using Microsoft Visual Studio 2010 x86 tools.

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>root


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.34/12 16 November 2013 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      http://root.cern.ch            *
    
  •                                     *
    

ROOT 5.34/12 (v5-34-12@v5-34-12, Nov 19 2013, 21:03:45 on win32)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .L chn2hist.C+
Info in TWinNTSystem::ACLiC: creating shared library C:\root\macros\chn2hist_C
.dll
2289281_cint.cxx
Error: class,struct,union or type __w64 not defined c:\program files (x86)\micr
osoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(29)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(79)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(110)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(141)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(153)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(163)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(174)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(184)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(194)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(206)
Error: class,struct,union or type vc_attributes::PreAttribute not defined c:\pr
ogram files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceann
otations.h(256)
Error: class,struct,union or type vc_attributes::PostAttribute not defined c:\p
rogram files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourcean
notations.h(257)
Error: class,struct,union or type vc_attributes::FormatStringAttribute not defin
ed c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis
sourceannotations.h(258)
Error: class,struct,union or type vc_attributes::InvalidCheckAttribute not defin
ed c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis
sourceannotations.h(259)
Error: class,struct,union or type vc_attributes::SuccessAttribute not defined c
:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourc
eannotations.h(260)
Error: class,struct,union or type vc_attributes::PreBoundAttribute not defined
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sour
ceannotations.h(261)
Error: class,struct,union or type vc_attributes::PostBoundAttribute not defined
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sou
rceannotations.h(262)
Error: class,struct,union or type vc_attributes::PreRangeAttribute not defined
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sour
ceannotations.h(263)
Error: class,struct,union or type vc_attributes::PostRangeAttribute not defined
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sou
rceannotations.h(264)
Error: class,struct,union or type __w64 not defined C:\Program Files (x86)\Micr
osoft Visual Studio 10.0\VC\INCLUDE\vadefs.h(48)
Error: class,struct,union or type __w64 not defined C:\Program Files (x86)\Micr
osoft Visual Studio 10.0\VC\INCLUDE\crtdefs.h(418)
Error: class,struct,union or type __w64 not defined C:\Program Files (x86)\Micr
osoft Visual Studio 10.0\VC\INCLUDE\crtdefs.h(436)
Error: class,struct,union or type __w64 not defined C:\Program Files (x86)\Micr
osoft Visual Studio 10.0\VC\INCLUDE\crtdefs.h(473)
Error: class,struct,union or type __int64 not defined C:\Program Files (x86)\Mi
crosoft Visual Studio 10.0\VC\INCLUDE\crtdefs.h(478)
Error: Symbol _locale_tstruct, is not defined in current scope C:\Program Files
(x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\crtdefs.h(1963)
Error: Symbol _locale_t is not defined in current scope C:\Program Files (x86)
Microsoft Visual Studio 10.0\VC\INCLUDE\crtdefs.h(1963)
Error: class,struct,union or type __int64 not defined C:\Program Files (x86)\Mi
crosoft Visual Studio 10.0\VC\INCLUDE\yvals.h(553)
Error: class,struct,union or type _ULonglong not defined C:\Program Files (x86)
\Microsoft Visual Studio 10.0\VC\INCLUDE\stdint.h(60)
Error: class,struct,union or type _ULonglong not defined C:\Program Files (x86)
\Microsoft Visual Studio 10.0\VC\INCLUDE\stdint.h(63)
Error: class,struct,union or type _ULonglong not defined C:\Program Files (x86)
\Microsoft Visual Studio 10.0\VC\INCLUDE\stdint.h(66)
Error: class,struct,union or type _ULonglong not defined C:\Program Files (x86)
\Microsoft Visual Studio 10.0\VC\INCLUDE\stdint.h(69)
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing C:\root\macros\chn2hist_C_ACLiC_dict.cxx C:\root\macros\chn2hist_C_A
CLiC_dict.h !!!
Error: C:\root\bin\rootcint: error loading headers…
Error in : Dictionary generation failed!
Info in : Invoking compiler to check macro’s validity
root [1][/code]

And now?
Thanks

Hello,

I’ve found a thread:

[url]Root and VC++2008 Express Edition

He/she had a similar problem. Here is the reaction of root:

[code]C:>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

C:>cl
Microsoft ® 32-Bit C/C+±Optimierungscompiler Version 16.00.30319.01 für 80x86

Copyright © Microsoft Corporation. Alle Rechte vorbehalten.

Syntax: cl [ Option… ] Dateiname… [ /link Linkeroption… ]

C:>root


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.34/12 16 November 2013 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      http://root.cern.ch            *
    
  •                                     *
    

ROOT 5.34/12 (v5-34-12@v5-34-12, Nov 19 2013, 21:03:45 on win32)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] .!cl
Microsoft ® 32-Bit C/C+±Optimierungscompiler Version 16.00.30319.01 für 80x86

Copyright © Microsoft Corporation. Alle Rechte vorbehalten.

Syntax: cl [ Option… ] Dateiname… [ /link Linkeroption… ]
root [1] .L chn2hist.C+
Info in TWinNTSystem::ACLiC: creating shared library C:\root\macros\chn2hist_C
.dll
2462090_cint.cxx
Error: class,struct,union or type __w64 not defined c:\program files (x86)\micr
osoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(29)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(79)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(110)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(141)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(153)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(163)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(174)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(184)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(194)
Syntax error c:\program files (x86)\microsoft visual studio 10.0\vc\include\code
analysis\sourceannotations.h(206)
Error: class,struct,union or type vc_attributes::PreAttribute not defined c:\pr
ogram files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceann
otations.h(256)
Error: class,struct,union or type vc_attributes::PostAttribute not defined c:\p
rogram files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourcean
notations.h(257)
Error: class,struct,union or type vc_attributes::FormatStringAttribute not defin
ed c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis
sourceannotations.h(258)
Error: class,struct,union or type vc_attributes::InvalidCheckAttribute not defin
ed c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis
sourceannotations.h(259)
Error: class,struct,union or type vc_attributes::SuccessAttribute not defined c
:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourc
eannotations.h(260)
Error: class,struct,union or type vc_attributes::PreBoundAttribute not defined
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sour
ceannotations.h(261)
Error: class,struct,union or type vc_attributes::PostBoundAttribute not defined
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sou
rceannotations.h(262)
Error: class,struct,union or type vc_attributes::PreRangeAttribute not defined
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sour
ceannotations.h(263)
Error: class,struct,union or type vc_attributes::PostRangeAttribute not defined
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sou
rceannotations.h(264)
Error: class,struct,union or type __w64 not defined C:\Program Files (x86)\Micr
osoft Visual Studio 10.0\VC\INCLUDE\vadefs.h(48)
Error: class,struct,union or type __w64 not defined C:\Program Files (x86)\Micr
osoft Visual Studio 10.0\VC\INCLUDE\crtdefs.h(418)
Error: class,struct,union or type __w64 not defined C:\Program Files (x86)\Micr
osoft Visual Studio 10.0\VC\INCLUDE\crtdefs.h(436)
Error: class,struct,union or type __w64 not defined C:\Program Files (x86)\Micr
osoft Visual Studio 10.0\VC\INCLUDE\crtdefs.h(473)
Error: class,struct,union or type __int64 not defined C:\Program Files (x86)\Mi
crosoft Visual Studio 10.0\VC\INCLUDE\crtdefs.h(478)
Error: Symbol _locale_tstruct, is not defined in current scope C:\Program Files
(x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\crtdefs.h(1963)
Error: Symbol _locale_t is not defined in current scope C:\Program Files (x86)
Microsoft Visual Studio 10.0\VC\INCLUDE\crtdefs.h(1963)
Error: class,struct,union or type __int64 not defined C:\Program Files (x86)\Mi
crosoft Visual Studio 10.0\VC\INCLUDE\yvals.h(553)
Error: class,struct,union or type _ULonglong not defined C:\Program Files (x86)
\Microsoft Visual Studio 10.0\VC\INCLUDE\stdint.h(60)
Error: class,struct,union or type _ULonglong not defined C:\Program Files (x86)
\Microsoft Visual Studio 10.0\VC\INCLUDE\stdint.h(63)
Error: class,struct,union or type _ULonglong not defined C:\Program Files (x86)
\Microsoft Visual Studio 10.0\VC\INCLUDE\stdint.h(66)
Error: class,struct,union or type _ULonglong not defined C:\Program Files (x86)
\Microsoft Visual Studio 10.0\VC\INCLUDE\stdint.h(69)
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing C:\root\macros\chn2hist_C_ACLiC_dict.cxx C:\root\macros\chn2hist_C_A
CLiC_dict.h !!!
Error: C:\root\bin\rootcint: error loading headers…
Error in : Dictionary generation failed!
Info in : Invoking compiler to check macro’s validity
root [2][/code]

What’s wrong?

Hi,

To make sure your installation is correct, can you simply try with one of the ROOT tutorials, for example hsimple.C:[code]Setting environment for using Microsoft Visual Studio 2010 x86 tools.

C:\Users\bellenot>cd root\tutorials

C:\Users\bellenot\root\tutorials>root -l

Welcome to the ROOT tutorials

Type “.x demos.C” to get a toolbar from which to execute the demos

Type “.x demoshelp.C” to see the help window

==> Many tutorials use the file hsimple.root produced by hsimple.C
==> It is recommended to execute hsimple.C before any other script

root [0] .x hsimple.C+
Info in TWinNTSystem::ACLiC: creating shared library C:\Users\bellenot\root\tu
torials\hsimple_C.dll
25960133_cint.cxx
hsimple_C_ACLiC_dict.cxx
Creating library C:\Users\bellenot\root\tutorials\hsimple_C.lib and object C:
\Users\bellenot\root\tutorials\hsimple_C.exp
hsimple : Real Time = 0.97 seconds Cpu Time = 0.55 seconds
(class TFile*)0x2396570
root [1][/code]If this works, that means there is a problem with your code…

Cheers, Bertrand.

That’s the result:

[code]C:>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

C:>cd root\tutorials

C:\root\tutorials>root -1


  •                                     *
    
  •    W E L C O M E  to  R O O T       *
    
  •                                     *
    
  • Version 5.34/12 16 November 2013 *
  •                                     *
    
  • You are welcome to visit our Web site *
  •      http://root.cern.ch            *
    
  •                                     *
    

ROOT 5.34/12 (v5-34-12@v5-34-12, Nov 19 2013, 21:03:45 on win32)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.

Welcome to the ROOT tutorials

Type “.x demos.C” to get a toolbar from which to execute the demos

Type “.x demoshelp.C” to see the help window

==> Many tutorials use the file hsimple.root produced by hsimple.C
==> It is recommended to execute hsimple.C before any other script

root [0] .x hsimple.C+
Info in TWinNTSystem::ACLiC: creating shared library C:\root\tutorials\hsimple
_C.dll
2259289_cint.cxx
hsimple_C_ACLiC_dict.cxx
Bibliothek “C:\root\tutorials\hsimple_C.lib” und Objekt “C:\root\tutorials\hs
imple_C.exp” werden erstellt.
hsimple : Real Time = 0.44 seconds Cpu Time = 0.42 seconds
(class TFile*)0x34e5f48
root [1][/code]

And I get a graphic with the caption: “This is the px distribution”. Thus ROOT works fine, but the code is the problem.
So I have to ask that person who gave me the code (the instructor/teacher at university). It’s for my homework.

Thank you for the help :slight_smile: