Make from cygwin window in $ROOTSYS/test

I have installed the last version of cygwin on my PC running Windows XP. From the cygwin window I go to $ROOTSYS/test and type make. I had then a lot of error messages coming from the reading of file “root-config”. Going to $ROOTSYS/bin, I typed “dos2unix root-config” and these error messages disappeared. Unfortunatly, make failed during the first link, after succesful compilation of “Event” and of “EventDict”. The error message was the following:

link -DLL -opt:ref -nologo Event.obj EventDict.obj libEvent.exp -include:_G__cpp_setupG__Net -include:_G__cpp_setupG__IO -include:_G__cpp_setupG__Hist -includ
:_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
etupG__PostScript -include:_G__cpp_setupG__Matrix -include:_G__cpp_setupG__Physics ‘d:\app\extlib\ROOT\v5_18_00\root\lib\libCore.lib’ ‘d:\app\extlib\ROOT\v5_18
00\root\lib\libCint.lib’ ‘d:\app\extlib\ROOT\v5_18_00\root\lib\libRIO.lib’ ‘d:\app\extlib\ROOT\v5_18_00\root\lib\libNet.lib’ ‘d:\app\extlib\ROOT\v5_18_00\root
ib\libHist.lib’ ‘d:\app\extlib\ROOT\v5_18_00\root\lib\libGraf.lib’ ‘d:\app\extlib\ROOT\v5_18_00\root\lib\libGraf3d.lib’ ‘d:\app\extlib\ROOT\v5_18_00\root\lib\l
bGpad.lib’ ‘d:\app\extlib\ROOT\v5_18_00\root\lib\libTree.lib’ ‘d:\app\extlib\ROOT\v5_18_00\root\lib\libRint.lib’ ‘d:\app\extlib\ROOT\v5_18_00\root\lib\libPosts
ript.lib’ ‘d:\app\extlib\ROOT\v5_18_00\root\lib\libMatrix.lib’ ‘d:\app\extlib\ROOT\v5_18_00\root\lib\libPhysics.lib’
link: invalid option – D
Try `link --help’ for more information.
make: *** [libEvent.dll] Error 1

Thanks for your help


Simply do
mv /usr/bin/link.exe /usr/bin/link_cygwin.exe
It gets into the way of MSVC’s link.

Concerning the root-config problem: I assume you downloaded the binaries? As a tar.gz? Did you unpack it using cygwin or using e.g. winzip?

Cheers, Axel.

Many thanks Axel, it works!
Concerning your questions:
(1) - Yes I have downloaded the binary, “good old tar file”
(2) - I unpacked it using winzip, not using cygwin. Should I rather make tar xvzf under cygwin?

Now a question: do you know of a web site explaining what one has to do on cygwin in order that it works with ROOT, where I could have seen for instance this mysterious
mv /usr/bin/link.exe /usr/bin/link_cygwin.exe ?

Sorry, Axel, in fact it does not work!
It is true that now I can compile and link everything in $ROOTSYS/test from a cygwin window, but none of the .exe produced work!!! I had first the message:
MSVCR80.dll not found
so I copied this file and 2 others [msvcp80.dll and msvcm.dll] from the directory
…\VC\redist\x86\Microsoft.VC80.CRT into the 2 directories $ROOTSYS\bin and $ROOTSYS\lib
But then I had the message:
“attempt to load the C runtime library incorrectly”

Notice that when I compile and link everything in $ROOTSYS\test using the “Visual Studio Command prompt” with the command
nmake -f Makefile.win32
everything works ok!
So it means that many other things have to be done to cygwin in order to be able to compile and link correctly!


do the exes not work when started from a cygwin window or from a dos shell? Do you have PATH set up such that the dlls can be found? You can e.g. add to by cygwin.bat, before bash gets invoked:
call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
which will set up the directories.

I have submitted a patch for the link.exe issue. The problem is so old that we all got used to it by now, but that’s of course not a good reason to ignore it :slight_smile:

Cheers, Axel.

When produced using “make” in the cygwin window, the .exe do not work when clicking twice on them. They produce the quoted error messages

When produced using “nmake” in the “Visual Studio command prompt” window, they work perfectly. Since they work in this case, I think my “PATH” variable in the window configuration panel is good. Since cygwin takes this “PATH” variable, I do not think the problem is there. Aniway, here is my PATH variable seen within a cygwin window:
$ echo $PATH
drive/c/Program Files/Hummingbird/Connectivity/11.00/Accessories/:/cygdrive/c/Program Files/Microsoft SQL Server/90/Tool
s/Binn/:/cygdrive/c/Program Files/Windows Imaging/:/cygdrive/d/app/KDE4/lib:/cygdrive/c/Program Files/QuickTime/QTSystem

Several years ago, I was able to compile and link inside a cygwin window or inside the “Visual command prompt window”, but the first possibility disappeared when I loaded a new version of cygwin. It is not peculiar to my PC, my colleagues at Saclay have the same problem. It seems very difficult to solve this problem by mail. Next time I am at CERN with a PC with the problem, I will try to meet you.


Yes, that sounds like a good idea! The MSVC library loading is still a total mess :-/

Cheers, Axel.