Serge
Serge

Reputation: 1067

How to suppress all warnings from non-solution files in VisualStudio

I wonder, whether it is possible to suppress warnings coming from included library files, while showing all solution-file warnings in Visual Studio? I have a solution that uses stingray library. When I build the solution I keep getting numerous warnings from stingray files, so I am loosing warnings from my files (that are actually in solution and that I own and edit). For me there is no value in included warnings, since I cannot edit those files, but I do need to see all my warnings.

Is there any way I could do it?

Added after first answer: Sorry for being not clear - I am not building third party library - I am linking the libraries they provided, but I am including their headers in my own - as a results I have numerous warnings in "file included from..." - is there any way to sort that out?

-- Thanks in advance

Upvotes: 7

Views: 2264

Answers (2)

Alex F
Alex F

Reputation: 43311

#pragma warning(push ,3)

# include third-party h-files

#pragma warning(pop)

Another way:

#pragma warning(disable: 4507 4510)

# include third-party h-files

#pragma warning(default: 4507 4510)

Upvotes: 7

jack-london
jack-london

Reputation: 1619

Open your third party library's project properties, you can minimize your warning level in build tab.

Upvotes: 0

Related Questions