unable to edit command line for a project

Trying to compile and execute a C++ project in VS2005 I ran into a linker problem. After some investigation it turned out that the calling convention was not what it was supposed to be for the functions used in the program. I changed the option for the calling convention from /Gd to /Gz. I needed __stdcall to be made.

After that I got this error message:

Error 1 Command line error D8016 : '/clr:pure' and '/Gz' command-line options are incompatible

The command line now looks like this:

/Od /I "C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /FD /EHa /MDd /Yu"stdafx.h" /Fp"Debug\SocketsCplus.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /Zi /clr:pure /Gz /TP /errorReport:prompt /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Data.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Drawing.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Windows.Forms.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.XML.dll"

My problem is that I cannot edit it. The browser does not allow me to make the display editable. I tried many tricks to no avail. What is the workabout for this It seems the command line does allow additions but no deletions. Weird.

Thanks.



Answer this question

unable to edit command line for a project

  • John Vivoda

    1) If you want to still compile /CLR you need to compile with /MD and not /MT.
    You can do that by going to the project properties --> Configuration Properties --> C/C++ --> Code Generation and set the Runtime Library field to Multi-threaded DLL (/MD) or Multi-threaded Debug DLL (/MDd).

    2) If you don't want to compile with /CLR, you can get rid of the switch by going to the project properties --> Configuration Properties -->General and set the Common Language Runtime Support to No Common Language Runtime Support.

    Thanks,
      Ayman Shoukry
      VC++ Team

  • Nasir Javed

    Could you share out what is in your build log Do you see /CLR:pure there

    Thanks,
      Ayman Shoukry
      VC++ Team

  • pfelsted

    Thank Ayman. Folowing your instrutions closely (it is not to say that I did something different before) I set project properties --> Configuration Properties --> C/C++ --> Code Generation and set the Runtime Library field to Multi-threaded DLL (/MD)

    Then I tried to compile.

    Build Log
       

    Build started: Project: SocketsCplus, Configuration: Debug|Win32

    Command Lines
       
    Creating temporary file "c:\Documents and Settings\......\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\RSP00000122761880.rsp" with contents [ /Od /I "C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include" /D "WIN32" /D "_DEBUG" /D "_ATL_MIN_CRT" /D "_MBCS" /FD /MD /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /clr /Gz /TP /prefast /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Data.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Drawing.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Windows.Forms.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.XML.dll" -clr:pure ".\SocketsCplus.cpp" ".\AssemblyInfo.cpp" ] Creating command line "cl.exe @"c:\Documents and Settings\......\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\RSP00000122761880.rsp" /nologo /errorReport:prompt" Creating temporary file "c:\Documents and Settings\......\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\RSP00000222761880.rsp" with contents [ /Od /I "C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include" /D "WIN32" /D "_DEBUG" /D "_ATL_MIN_CRT" /D "_MBCS" /FD /MD /Yc"stdafx.h" /Fp"Debug\SocketsCplus.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /clr /Gz /TP /prefast /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Data.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Drawing.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Windows.Forms.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.XML.dll" -clr:pure ".\stdafx.cpp" ] Creating command line "cl.exe @"c:\Documents and Settings\........\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\RSP00000222761880.rsp" /nologo /errorReport:prompt" 
    Output Window
       
    Compiling... cl : Command line warning D9035 : option 'prefast' has been deprecated and will be removed in a future release cl : Command line warning D9036 : use 'analyze' instead of 'prefast' cl : Command line warning D9025 : overriding '/clr' with '/clr:pure' cl : Command line error D8016 : '/Gz' and '/clr:pure' command-line options are incompatible 
    Results
       
    Build log was saved at "file://c:\Documents and Settings\.......\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\BuildLog.htm" SocketsCplus - 1 error(s), 3 warning(s) 


    You can see that the error message claims that the language option was /clr:pure which is not the case at all. It is /clr. CLR:PURE is a separate option in there. Now it conflicts with /Gz that is __stdcall calling convention and I need precisely that because I was getting a linkage errors before on that account.

    As I said I tried many other combinations before to try to get out of the loop but always failed. I will post more examples.

    I need your help.

    Thanks.

  • Todd B. Schroeder

    Were you able to resolve this problem


  • callaway59

    I just changed "Common Language Runtime Support" to "No Common Language Runtime Support" and the "/clr:pure" still appeared in the command line and I got an error that '/MT' and '/clr:pure' command-line options are incompatible'

    What is going on


  • dadomingues

    I figured out how the project manager is supposed to be used to edit the command line and I changed a few options. I must admit I am doing it without deep understanding just trying to bulldose my way through.

    I removed the /clr:pure completely. However I am still getting an error message as IF IT IS STILL THERE:

    Error 3 Command line error D8016 : '/Gz' and '/clr:pure' command-line options are incompatible 

    This is a copy of my command line:

    /Od /I "C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /FD /MDd /Yu"stdafx.h" /Fp"Debug\SocketsCplus.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /Z7 /Gz /TP /prefast /errorReport:prompt

    I do not see any CLR:pure in there at all. It has been removed from the database.

    Help please.

    Thanks.

  • Mike_Vere

    Thanks,

    I could not wait for the answer and kept tinckering wih parameters feverisly. I think I exhausted all possible combinatins. Every combination seems to cause a compler time error similar to the one posted before.

    Next tme I post a message I will copy the .log file as a whole. Now I am giving you a copy of the log rom my latest permutation of parameters. It is NOT the one you've requested. I also blackened my first and last names.

    Build Log
      

    Build started: Project: SocketsCplus, Configuration: Debug|Win32

    Command Lines
      
    Creating temporary file "c:\Documents and Settings\***** *********\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\RSP00002823681088.rsp" with contents [ /Od /I "C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_ATL_MIN_CRT" /FD /MT /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /clr /Gz /TP /prefast /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Data.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Drawing.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Windows.Forms.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.XML.dll" -clr:pure ".\SocketsCplus.cpp" ".\AssemblyInfo.cpp" ] Creating command line "cl.exe @"c:\Documents and Settings\***** *****\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\RSP00002823681088.rsp" /nologo /errorReport:prompt" Creating temporary file "c:\Documents and Settings\**** ******\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\RSP00002923681088.rsp" with contents [ /Od /I "C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_ATL_MIN_CRT" /FD /MT /Yc"stdafx.h" /Fp"Debug\SocketsCplus.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /clr /Gz /TP /prefast /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Data.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Drawing.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.Windows.Forms.dll" /FU "c:\WINNT\Microsoft.NET\Framework\v2.0.50215\System.XML.dll" -clr:pure ".\stdafx.cpp" ] Creating command line "cl.exe @"c:\Documents and Settings\**** *********\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\RSP00002923681088.rsp" /nologo /errorReport:prompt" 
    Output Window
      
    Compiling... cl : Command line error D8016 : '/MT' and '/clr' command-line options are incompatible 
    Results
      
    Build log was saved at "file://c:\Documents and Settings\**** *******\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\BuildLog.htm" SocketsCplus - 1 error(s), 0 warning(s) 

    I simply cannot get rid of /clr in various incarnations. It often pops up by itself if I choose no CLR support.

    I may take a break until tomorrow to proceed. Perhaps new ideas will come up. I would appreciate any help, though.

    thanks.

  • jsminch




    Build Log
      

    Build started: Project: SocketsCplus, Configuration: Debug|Win32

    Command Lines
      
    Creating temporary file "c:\Documents and Settings\ALEX BLAIVAS\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\RSP00000123322164.rsp" with contents [ /Od /I "C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include" /D "WIN32" /D "_DEBUG" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /FD /MT /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Gz /TP /prefast -clr:pure ".\SocketsCplus.cpp" ".\AssemblyInfo.cpp" ] Creating command line "cl.exe @"c:\Documents and Settings\......\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\RSP00000123322164.rsp" /nologo /errorReport:prompt" Creating temporary file "c:\Documents and Settings\......\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\RSP00000223322164.rsp" with contents [ /Od /I "C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include" /D "WIN32" /D "_DEBUG" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /FD /MT /Yc"stdafx.h" /Fp"Debug\SocketsCplus.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Gz /TP /prefast -clr:pure ".\stdafx.cpp" ] Creating command line "cl.exe @"c:\Documents and Settings\......\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\RSP00000223322164.rsp" /nologo /errorReport:prompt" 
    Output Window
      
    Compiling... cl : Command line warning D9035 : option 'prefast' has been deprecated and will be removed in a future release cl : Command line warning D9036 : use 'analyze' instead of 'prefast' cl : Command line error D8016 : '/MT' and '/clr:pure' command-line options are incompatible 
    Results
      
    Build log was saved at "file://c:\Documents and Settings\......\My Documents\Visual Studio 2005\Projects\SocketsCplus\SocketsCplus\Debug\BuildLog.htm" SocketsCplus - 1 error(s), 2 warning(s) 

    Take a look at the command line. -clr:pure is excluded but it still gives me an error!

  • JohnnieMac

    I just made a single change /MD --> /MT. The result:

    Error 1 Command line error D8016 : '/MT' and '/clr' command-line options are incompatible.


  • Nick Hustak

    I might be missing something in your questions, but you want to use /Gz but you still want to use /CLR:pure. This is not allowed in VC2005. Which option do you want to get rid of

    Thanks,
      Ayman Shoukry
      VC++ Team

  • unable to edit command line for a project