Thursday, December 24, 2020

Warning C4653 compiler option 'Optimizations (one or more of /Oawstgp[y]) or debug checks (one or more of /GZ, /RTCcsu)' inconsistent with precompiled header; current command-line option ignored

When I compile this project, I play around with more configuration in Visual Studio 2017. then I run into the following two warnings:

Warning C4653: compiler option 'Optimizations (one or more of /Oawstgp[y]) or debug checks (one or more of /GZ, /RTCcsu)' inconsistent with precompiled header; current command-line option ignored Project c:\demo_temp\outlooktabctrl_src\containerbar\containerbar.cpp 7

Warning C4651: '/D__MSVC_RUNTIME_CHECKS' specified for precompiled header but not for current compile Project c:\demo_temp\outlooktabctrl_src\containerbar\containerbar.cpp 7

MY playing is at: Configraton Properties->C/C++ -> Code Generation -> Enable String Pooling: I select "YES / GF"; Basic Runtime Checks: I set to "Both (RTC1)". Note: if I set to this value, then the warnings are gone.

if I played at Configraton Properties-> Linker -> Optimization -> References -> I set to : "YES (/OPT:REF)", I will run into the following warning message:

Warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification Project C:\Demo_Temp\OutlookTabCtrl_src\LINK 1

  1. LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
  2. the good explanation /solution is:

    You can either have "Edit and continue" support or optimizations. Usually, you put "Edit and continue" on debug builds, and optimizations on release builds.

    Edit and continue allows you to change code while you are debugging and just keep the program running. It's not supported if the code also has to be optimized.

    another good explanation/solution is below:

    I also got this warning when converting a VS2008 project from .lib to .dll and the workaround was to change the Linker/Optimization settings on the Debug Win32 configuration from Default to:
    References = Keep Unreferenced Data (/OPT:NOREF)
    Enable COMDAT Folding = Do Not Remove Redundant COMDATs (/OPT:NOICF)

  3. OutlookTabCtrl, like CBCGPOutlookBar (in Mode2003)
  4. CSizingControlBar - A Resizable Control Bar

No comments:

Post a Comment