Share via


Compiler Error C2220

warning treated as error - no object file generated

/WX tells the compiler to treat all warnings as errors. Because an error occurred, no object or executable file was generated.

This error only appears when the /WX flag is set and a warning occurs during compilation. To fix this error, you must eliminate every warning in your project.

To fix, use one of the following techniques

  1. Fix the problems that cause warnings in your project.

  2. Compile at a lower warning level—for example, use /W3 instead of /W4.

  3. Use a warning pragma to disable or suppress a specific warning.

  4. Don’t use /WX to compile.