Search code examples
visual-studiocommandwarningsdisable

Enable/disable warnings, visual studio comand prompt


I know that this question is almost the same with this , but I still don't understand how to do it in command prompt. Here is what I'm doing:

  1. I need to compile old source code of 7z archivation tool, so I downloaded it.

  2. Now I am running nmake in the 7z_version/CPP/7zip and it shows me errors:

C2220: warning treated as error - no 'object' file generated.

So here is the question: how to disable this warning? I am using VS comand prompt, because IDE cannot understand the project folder.


Solution

  • It's actually not a warning, but an error (about the warning being treated as an error). So either you fix the original warning (should be printed a bit earlier in the build log) or you modify the compiler options to not treat warnings as errors: remove the /WX flag, or if the project file is msbuild based then set TreatWarningAsError to false.

    edit this is nmake based, remove -WX from line 26 in CPP\Build.mak