One of my .cpp files is generating warning C4275 due to a 3rd-party header I #include
... (the warning is triggered due to a DLL-export class inheriting from a non-DLL-export class as far as I can tell).
I added the line:
#pragma warning(disable : 4275)
As the first line of my .cpp file and yet the warning is still being generated. This is on VC++ 2008, and no PCH is in use.
Why is my #pragma
not working, and (other than changing the 3rd-party code) how can I address this?
Generate a preprocessed file and you'll probably find that some other header file's re-enabling the warning.
I haven't seen this particular warning, but in Visual Studio, you can disable specific warnings via project properties (i.e., not pragma). Disabling them that way seems to be "stronger" than disabling them via a pragma. You might do that for just the one file you're using.
Of course, warnings frequently tell you something useful, so this would really be a last resort.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With