Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to stop MSYS/MinGW from transforming what it thinks are paths on my command lines? I have a project that's using nmake & Microsoft Visual Studio 2003 (yeecccch). I have the build system all ported and ready to go for GNU make (and tested with Cygwin). Something weird is happening to my compiler flags when I try to compile in an MSYS environment, though. Here's a simplified example:

$ cl /nologo
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.6030 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:nologo.exe
C:/msys/1.0/nologo
LINK : fatal error LNK1181: cannot open input file 'C:/msys/1.0/nologo.obj'

As you can see, MSYS is transforming the /nologo compiler switch into a windows path, and then sending that to the compiler. I really don't want this to happen - in fact I'd be happy if MSYS never transformed any paths - my build system had to take care of all that when I first ported to Cygwin. Is there a way to make that happen?

It does work to change the command to

$ cl -nologo

Which produces the expected results, but this build system is very large and very painful to update. I really don't want to have to go in and change every use of a / for a flag to a -. In particular, there may be tools that don't support the use of the - at all, and then I'll really be stuck.

Thanks for any suggestions!

share|improve this question
2  
Posting on superuser since the fact that it's a compiler isn't really the problem, it's a general MSYS vs native application problem. –  Carl Norum Mar 12 '10 at 6:05

2 Answers 2

I found this question while searching for a way to run a windows program which requires an argument in the form:

/arg:<path>

where path must be a fully qualified windows path

I just wanted to elaborate on the following from the original question:

It does work to change the command to

cl -nologo

Which produces the expected results .... In particular, there may be tools that don't support the use of the - at all, and then I'll really be stuck.

As the original poster suggests, transforming the argument using - as follows, works perfectly:

-arg:<path>

I was actually really surprised by this, as this is not documented by the program's help. It just so happens the program in this case is also made by Microsoft (as is nmake in the original poster's case). So if the program you're attempting to run is made by Microsoft give this a shot even if it's undocumented.

Hopefully there aren't any programs out there that use this (imho insane) form of command line arguments outside of Microsoft, if there are, I don't think it's possible to run them with MSYS

share|improve this answer
up vote 0 down vote accepted

The final answer is that there is fact no way to stop this behaviour. I had to go through every line in the build system and change every / into a -.

share|improve this answer
    
Boo! Hiss! You could try posting to the mailing list (lists.sourceforge.net/lists/listinfo/mingw-users) to request a bug-fix. –  Synetech Feb 21 '11 at 18:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.