Houston, I've got a problem! (solved)


I’ve installed ROOT on my machine, which is running under Windows Millenium with cygwin, and I use Visual C++ for programming. For the moment I have copied all root/include files into vc++/include, and I try to compile under VC++ but I have the following error message: “vc++\include\ostream.h(148) : error C2872: ‘ios’ : ambiguous symbol” (and with ‘streambuf’, ‘ostream’, etc.) So how can I solve this problem?


Hello. You DO NOT need to copy any headers to VC directories. If you do not need root sources, you can download binaries (I gues, you’ve already done). If you want to work with cygwin, again, you do not need copy anything.
You’d better read about ROOT’s installation - you can even get example of bash_profile for your cygwin.

Thank you for your response.

In fact, just after posting my message, I found that I didn’t need to copy includes… :blush: I did not know that I could specify several includes directories to VC++… Libraries are all where they should be now.

But I still have the message “c:\utils\vc++\include\ios.h(160) : error C2872: ‘ostream’ : ambiguous symbol”

I prefer to compile with VC++ than with cygwin, I’m not familiar with makefiles… And yes, I’ve downloaded the binary version root_v4.03.02.win32gcc - not the VC++ one because it seemed to have problems with old windows versions.

I’ve also tried the test\Makefile:

synapses@homer ~/root/test $ ./Makefile include: not found ObjSuf: not found ObjSuf: not found EVENTO: not found SrcSuf: not found SrcSuf: not found EVENTS: not found DllSuf: not found EVENTSO: not found ExeSuf: not found EVENT: not found ./Makefile: 17: Syntax error: word unexpected (expecting ")")

and the test\Makefile.win32:

synapses@homer ~/root/test $ ./Makefile.win32 ObjSuf: not found SrcSuf: not found ExeSuf: not found DllSuf: not found OutPutOpt: not found ./Makefile.win32: 8: Syntax error: newline unexpected

Does anibody see what’s wrong?


Well, that’s (more) correct now : I had both Riostream.h and fstream.h includes.

But if someone knows anything about the Makefile…

Thank you for your help.

I tried with the version you are talking about, and with the test files you linked me to, but I still can’t execute the Makefile and the Makefile.win32.

Note that to run a makefile you do not do

./Makefile but you should do

gmake -f Makefile (and when the name is Makefile or GNUMakefile you can omit the -f Makefile)

gmake is called make in cygwin, so run make -f MakefileAxel.

Thank you very much. I have successfully run the test Makefile - using “make” - with the gcc version of ROOT, but the VC++ one doesn’t work :

synapses@homer ~/root/test $ make cl -O2 -G5 -GR -GX -MD -DWIN32 -D_WINDOWS -nologo -DVISUAL_CPLUSPLUS -D_X86_=1 -D_DLL -MD -I'C:\utils\cygwin\home\synapses\root\include' -c Event.cxx make: cl: Command not found make: *** [Event.obj] Error 127 It may not be very important, but if you have an idea…

Hi berder,
you have to set the environment variables for visual c++; see http://root.cern.ch/cgi-bin/print_hit_bold.pl/root/roottalk/roottalk05/0360.html?vcvars32#first_hit and (if necessary) the whole thread at http://root.cern.ch/root/roottalk/roottalk05/index.html#360.

I have add the directory c:/utils/vc++/bin, where cl.exe is located, to PATH, but it doesn’t change anything.

Hi berder,
please add the path and all the other vars in vsvars32.bat to your system’s environment variables using Start->Settings->System->Advanced->Environment variables or something, or add the line “call …path…to…\vsvars32.bat” to C:\cygwin\cygwin.bat, before it calls bash. The way you’ve added it to $PATH variable is wrong (it’s not “c:/”, it’s “/cygdrive/c/”), and cl needs more than just the right path (it also needs to find its libraries and include files).

You can test whether you’ve set the path properly by opening a new bash shell and running “which cl”; it should print /cygdrive/c/utils/vc++/bin/cl if it worked correctly.


Thank you very much for your help, it almost works! (Note that on my computer the file is named “vcvars32.bat”)
I think this will be the last problem : the making starts, but ends saying the command “link” has too many arguments. Indeed, it seems to have far too many…[code]synapses@homer ~/root/test
$ make
bindexplib libEvent Event.obj EventDict.obj > libEvent.def
lib -nologo -MACHINE:IX86 Event.obj EventDict.obj -def:libEvent.def
Creating library libEvent.lib and object libEvent.exp
link -DLL -opt:ref -pdb:none -nologo Event.obj EventDict.obj libEvent.exp -include:_G__cpp_setupG__Hist -include:_G__cpp_setupG__Graf1 -include:_G__cpp_setupG__G3D -include:_G__cpp_setupG__GPad -include:_G__cpp_setupG__Tree -include:_G__cpp_setupG__Rint -include:_G__cpp_setupG__PostScript -include:_G__cpp_setupG__Matrix -include:_G__cpp_setupG__Physics C:\utils\cygwin\home\synapses\root\lib\libCore.lib’ ‘C:\utils\cygwin\home\synapses\root\lib\libCint.lib’ ‘C:\utils\cygwin\home\synapses\root\lib\libHist.lib’ ‘C:\utils\cygwin\home\synapses\root\lib\libGraf.lib’ ‘C:\utils\cygwin\home\synapses\root\lib\libGraf3d.lib’ ‘C:\utils\cygwin\home\synapses\root\lib\libGpad.lib’ ‘C:\utils\cygwin\home\synapses\root\lib\libTree.lib’ ‘C:\utils\cygwin\home\synapses\root\lib\libRint.lib’ ‘C:\utils\cygwin\home\synapses\root\lib\libPostscript.lib’ ‘C:\utils\cygwin\home\synapses\root\lib\libMatrix.lib’ ‘C:\utils\cygwin\home\synapses\root\lib\libPhysics.lib’ \ -out:libEvent.dll
link: too many arguments
Try `link --help’ for more information.
make: *** [libEvent.dll] Error 1

synapses@homer ~/root/test
$ link --help
Usage: link FILE1 FILE2 or: link OPTION
Call the link function to create a link named FILE2 to an existing FILE1.
–help display this help and exit
–version output version information and exit
Report bugs to bug-coreutils@gnu.org.
Do you see what is the problem? (Don’t lose your time, I don’t care if not… It should not be very important, does it?)

Hi berder,
you have your $PATH wrong. There are two link.exe on your system, one is cygwin, the other is visual c++. You need the visual c++ to be before the cygwin one. Make sure “which link” points to your visual c++ link.exe. Another option is to copy link.exe from the visual c++ dir to /usr/local/bin, and make sure that /usr/local/bin is in your $PATH before /bin or /usr/bin.

That’s OK!

Thank you very much, I’ve copied the VC++'s link.exe into /usr/local/bin and the “make” has worked.