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:
- In GCC: #pragma GCC system_header #include "real_3rd_party_header.h"
- And also the GCC -isystem option which lets you specify directories to suppress How to eliminate external lib/third party warnings in GCC I wish MSVC had something like this.
- And the #pragma push pop macros in MSVC but that only works on your own code. https://learn.microsoft.com/en-us/cpp/preprocessor/warning?view=vs-2019
- And also the new VS2017 solution https://devblogs.microsoft.com/cppblog/broken-warnings-theory/
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:
- Visual Studio 2015 and 2019.
- Boost 1.72
- OpenCV4
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.