[C++] [VS 2022] How to ignore warnings from external libraries

Darky 26 Reputation points
2022-11-14T17:55:26.163+00:00

Hello,

I have a C++ project and I would like to treat my warnings as errors (/W4 /WX).

My project has various dependencies on various libraries (using vcpkg), and for some reason warnings from their headers are shown during compilations.

First of all, I absolutely don't care about these warnings - they are external libraries, as long as they work fine I am not going to rewrite them, I only care about warnings related to my code.

Second, because the Error List is flooded with these "false positives", it is difficult to find actual warnings related to my code.

Lastly, I cannot compile my project because of warnings in external libraries and I am treating warnings as errors.

How can I tell Visual studio to stop doing that?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,882 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,633 questions
0 comments No comments
{count} vote

Accepted answer
  1. David Lowndes 4,711 Reputation points
    2022-11-14T18:13:34.62+00:00

    In your project properties, see the settings under C++, External Includes.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful