Problems installing root in Windows: can't find header files

Hi all,

I’ve been trying to get root installed on a Windows NT system, using Cygwin. I downloaded the binaries for root 5.02.00 and unpacked them in c:\root directory. I’ve set my path to include the root/bin directory, in both my .bash_profile and through the systems environmental settings in windows. I’ve also set the $LD_LIBRARY_PATH to include root/lib. This environmental variable doesn’t exist in the systems settings for windows, but I have added the root/lib to the lib variable and root/include to the include variable.

I can open the Cint fine, and can run macros without problems. But when I try and compile a program using root classes (such as TH1F, or any others), I get errors that the header files do not exist, as shown below

Administrator@VRS07462 /cygdrive/c/root/test
$ g++ -o hsimple hsimple.cxx
hsimple.cxx:20:19: TFile.h: No such file or directory
hsimple.cxx:21:17: TH1.h: No such file or directory
hsimple.cxx:22:17: TH2.h: No such file or directory
hsimple.cxx:23:22: TProfile.h: No such file or directory
hsimple.cxx:24:21: TNtuple.h: No such file or directory
hsimple.cxx:25:21: TRandom.h: No such file or directory
hsimple.cxx: In function int hsimple()': hsimple.cxx:41: error:TFile’ undeclared (first use this function)
hsimple.cxx:41: error: (Each undeclared identifier is reported only once for each function it appears in.)
hsimple.cxx:41: error: expected ;' before "hfile" hsimple.cxx:44: error:TH1F’ undeclared (first use this function)
hsimple.cxx:44: error: hpx' undeclared (first use this function) hsimple.cxx:44: error:TH1F’ has not been declared
hsimple.cxx:45: error: TH2F' undeclared (first use this function) hsimple.cxx:45: error:hpxpy’ undeclared (first use this function)
hsimple.cxx:45: error: TH2F' has not been declared hsimple.cxx:46: error:TProfile’ undeclared (first use this function)
hsimple.cxx:46: error: hprof' undeclared (first use this function) hsimple.cxx:47: error:TNtuple’ has not been declared
hsimple.cxx:50: error: Float_t' undeclared (first use this function) hsimple.cxx:50: error: expected;’ before "px"
hsimple.cxx:51: error: Int_t' undeclared (first use this function) hsimple.cxx:51: error: expected;’ before "i"
hsimple.cxx:51: error: i' undeclared (first use this function) hsimple.cxx:52: error:gRandom’ undeclared (first use this function)
hsimple.cxx:52: error: px' undeclared (first use this function) hsimple.cxx:52: error:py’ undeclared (first use this function)
hsimple.cxx:53: error: pz' undeclared (first use this function) hsimple.cxx:54: error: expected;’ before "random"
hsimple.cxx:58: error: random' undeclared (first use this function) hsimple.cxx:62: error:hfile’ undeclared (first use this function)

The same thing happens if I try and use the VC++ compiler. Does anyone have any idea why these header files are not being found? I appreciate the help.

-McG

I assume that you have downloaded the win32gcc version and not the normal
windows version. Your compile line is wrong.
I suggest to run make in the test directory to get all the tests compiled.
or run with
g++ -o hsimple hsimple.cxx root-config --cflags --glibs
where root-config is a small utility in $ROOTSYS/bin that will tell you
the compile and link options.

Are you sure that you want to run with the gcc version under Windows?
For your info, I found this option to be about 3 times slower than the VC++7.1 version.

Rene