Hi Karin,
[quote=“karineklund”]I am sorry, but I am confused and I don’t understand.[/quote]That’s my fault, I’ll explain things a bit more detailed now.
[quote=“karineklund”]I added the ROOTSYS in enviroment variables (C:\root since this is where I have root, but should it not be root\bin or lib or something?).[/quote]Where did you add it? In the control panel / system? Good. It should point to C:\root - not C:\root\bin.
[quote=“karineklund”]But what is the compiler I use with .L?[/quote] It’s the one used to build root - they have to be compatible. So in your case that’s called “cl”. ROOT needs to be able to find that compiler, that’s why it has to be in the %PATH% (the windows version of $PATH). And to get it there you can either edit your PATH environment variable (just like you did for ROOTSYS) - but then you’ll also have to add LIB and INCLUDE, which are needed by the compiler. Or you run the “Visual Studio Command Prompt”, which is just a “windows shell”, but with the proper environment variables set.
[quote=“karineklund”]I have gcc and it seems to be working. Good enough?[/quote]Depends on what ROOT build you’re using. Use the Microsoft compiler with the win32 build, and gcc with win32gcc. The first one is the official windows build.
[quote=“karineklund”]Should I write .h or .h+? If I write .h+ I get:
root [0] .L TVoxel.h+
Info in <TWinNTSystem::ACLiC>: creating shared library C:\karin\TVoxel_h.dll
'cl' is not recognized as an internal or external command,
operable program or batch file.
Internal error: G__copytotmpfile() 2
FILE:C:\DOCUME~1\ked\LOCALS~1\Temp/\s244._rootcint.h LINE:0
Error: cannot open file "C:\DOCUME~1\ked\LOCALS~1\Temp/\s244._rootcint.h" FILE: LINE:0
!!!Removing C:\karin\sh8_.cxx C:\karin\sh8_.h !!!
Error: rootcint: failed to open C:\karin\sh8_.cxx in ReplaceBundleInDict()
'cl' is not recognized as an internal or external command,
operable program or batch file.
Error in <ACLiC>: Compilation failed![/quote]That’s because the compiler is not in your PATH - you didn’t start root from within a Visual Studio Command prompt. Alternatively, you can start a regular command prompt, and run C:\Program Files\Microsoft Visual Studio 7\Common7\Tools\vsvars.bat before running root - that will set the environment variables.
[quote=“karineklund”]If I write .h it does not complain until I get to actually running testRun(), and then it says:
Error in <TBranchElement::GetDataMemberOffset>: obsolete call with (TVoxel,fUniqueID)
[...]
Error: C++ exception caught FILE:C:\karin\runTest.C LINE:22
(Int_t)0
*** Interpreter error recovered ***[/quote]Right, I/O of interpreted classes is not supported yet. You’ll have to compile TVoxel etc, e.g. by loading it as “.L TVoxel.h+”.
[quote=“karineklund”]But, then again, what I really want to do is to use VS c++ to write and run my root on windows. I have read your page about it, but beeing not only a beginner with root, I am even more so with VS, so I havn’t really managed to get that to work yet either. This will be my next step.[/quote]Let us know if you run into problems.
Cheers, Axel.