I am compiling a library with Microsoft C++ compiler and build tools. My build environment sets the compile flag /GL, but for a specific library I need to turn that flag off. I can do so with /GL-, but I get a warning D9025, which simply tells me I am overriding the previous setting. I want to suppress this warning. But the command line option /wd only forks for Cxxx errors and warnings, not Dxxx warnings. How do I suppress the D9025 warning?
If you migrate a project to Visual Studio 2019, you might suddenly be faced with a large number of code analysis warnings. If you aren't ready to fix the warnings, you can suppress all of them by selecting Analyze > Build and Suppress Active Issues.
Turn off the warning for a project in Visual StudioSelect the Configuration Properties > C/C++ > Advanced property page. Edit the Disable Specific Warnings property to add 4996 . Choose OK to apply your changes.
To display the Error List, choose View > Error List, or press Ctrl+\+E.
You cannot suppress D9025, you have to fix that. Command-line warning D9025 means you have conflicting options on cl.exe command line. In your case you have something like this:
cl ... /GL ... /GL- ...
Compiler actually uses the option that is specified last on the command line, but that command line is very confusing.
In your .vcxproj file make sure you have set correct option for WholeProgramOptimization property. Your configuration section might look like this:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
...
<WholeProgramOptimization>false</WholeProgramOptimization>
</PropertyGroup>
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