I compile some external C++ source code (not only headers) with the rest of my code, using Visual Studio 2013. It is not possible to edit this external source code. I want to disable all warnings or specific warnings for this source so that I can compile my project with /W4 /WX. Is that possible without editing these external files at all?
Asked
Active
Viewed 79 times
-1
-
Set `/W0` for compiling just those files. Use `#pragma warning` around the external headers when including the headers from your files. – Khouri Giordano Jan 24 '17 at 19:59
-
How do you compile? In the IDE you can turn off individual warnings in the "Advanced" settings of the Project Properties. If you feel really adventurous, you can change this for each individual file (not recommended). – Bo Persson Jan 24 '17 at 20:08
1 Answers
-1
Editing "Warning Level" or "Disable Specific Warning" in the properties of each .cpp file is what I needed in order to disable warnings for the .cpp (I did not know I could set properties per file).
The warnings of the .h are disabled with surrounding #include
with #pragma warning
.
Thank you for the answers you gave in the comments of my post.

Axel Williot
- 485
- 6
- 13