Reputation: 61
I'm working on a C++ project that uses OpenCV and Boost. Unfortunately when compiling, my compiler gives me hundreds of warnings from the include files of those libraries. Even with an empty main function and no other code I still get these warnings from the include statements. I've heard this is a problem with other 3rd party libraries like Qt. All great libraries. How can I suppress all 3rd party warnings in MSVC.
I know about these solutions:
I've spend hours on these last 2 solutions but without any success. The "broken warnings theory" blog doesn't explain how to apply its solution very well anyway.
I'm using:
I really appreciate anyone willing to help resolve this issue with me. It would be nice to know who has even solved this issue. So many companies use these libraries, some probably with MSVC. There's no way they just keep with the warnings there and forget about them. I'm at the point where I will pay money to get this resolved. Getting this to work may be the deciding factor between reusing 3rd party libraries and rewriting code myself.
Upvotes: 3
Views: 1932
Reputation: 76519
All this is from this blog post: https://devblogs.microsoft.com/cppblog/broken-warnings-theory/. The general tone of the introduction of the article speaks volumes about why this option wasn't there to begin with (and none of it makes much sense to me).
Basically this says you can use /external:I
as a synonym to -isystem
.
You will probably need /external:templates-
as well, due to the way MSVC handles warnings from templates.
Unfortunately, I cannot find any reference to any of this in the MSVC commandline documentation, nor the release notes related to the mentioned VS2017 15.6, so your mileage may vary.
There is though, a CMake issue requesting support for this feature behind their SYSTEM
modifier.
Upvotes: 2