Cygwin build fails

Cygwin build fails for msvc8. It was ok before, but couple of months ago cygwin started to give an error “link: unknown option – D” for debug build or “link: unknown option – O” for release build

mainroot.cxx tool/rmkdepend//mainroot.cxx(40) : warning C4273: 'unlink' : inconsistent dll linkage C:\Program Files (x86)\Microsoft Visual Studio 8\VC\INCLUDE\stdio.h(290) : see previous definition of 'unlink' link -DEBUG -nologo -ignore:4049 -ignore:4217 -ignore:4221 -incremental:no tool/rmkdepend//cppsetup.obj tool/rmkdepend//ifparser.obj tool/rmkdepend//include.obj tool/rmkdepend//main.obj tool/rmkdepend//parse.obj tool/rmkdepend//pr.obj tool/rmkdepend//mainroot.obj -out:tool/rmkdepend/rmkdepend.exe link: unknown option -- D Try `link --help' for more information. make: *** [tool/rmkdepend/rmkdepend.exe] Error 1

I’m not sure if it caused by majir cygwin update, or it is something else. Any help would be greatly appreciated.


cygwin’s link.exe gets into the way of msvc’s link.exe. Simple move it out of the way: mv /usr/bin/link.exe /usr/bin/link_cyg.exe

I will investigate the warning but it’s not harmful.

Cheers, Axel

Thank you, that worked

Hi Axel,

Especially if somebody is using both VC++ and gcc, this won’t work well… Shouldn’t it be sufficient to setup PATH so that the microsoft tools appear before the cygwin ones (as this has the benefit that one can easily redefine path to switch it back)?



yes, but this is simpler to implement (otherwise people have to edit .bashrc or similar, and mess around with the MSVC vars) and I did not see anybody ever using /usr/bin/link :slight_smile:

Cheers, Axel.