Friday, December 18, 2020

Warning LNK4075 ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification

when I compiled a legacy project from cp.com, I ran into this message after I set up the project as this:

Configuration Properties->C/C++ -> General -> Debug Information Format -> choose: Program Database for Edit And Continue (/ZI)

Warning LNK4075 ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification

the reason behind it is that there is a warning message related with No /Gy-. I configured it as:

Configuration Properties->C/C++ -> Code Generation -> Enable Functional-Level linking-> set :Yes (/Gy)

after some research, I need to set this value to:

Configuration Properties->C/C++ -> General -> DEbug Information Format -> choose: Program Database (/Zi)

  1. LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
  2. 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.

    one solution is: I had this problem too. I opened the Project Properties, and then clicked General in the C/C++ tab. There is an option that says 'Debug Information Format', which I changed to Program Database (/Zi), and I didn't get the warning anymore.

    another solution is : I also got this warning when converting a VS2008 project from .lib to .dll and the workaround was to change the Configuration Properties - > Linker -> Optimization -> Reference, or Enable COMDAT Folding 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)

    Another good check is this setting: We had to set "Generate Debug Info" to "Yes (/DEBUG)" under the project properties' Configuration Properties -> Linker -> Debugging -> Generate Debug Info-> Generate Debug Information (/DEBUG) . Not sure how that wasn't set for a debug build in the first place, or why that wouldn't be the default, but there you go. (VS2010, in case that's relevant.)

  3. Linker Tools Warning LNK4075
  4. ignoring "option1" due to "option2" specification

    The second option overrides the first.

    Mutually exclusive linker options are being specified. Examine your linker options. Where linker options are specified depends on how you are building your project.

    • If you are building in the development environment, look in the linker property pages for your project, and see where both linker options are being specified. See Set compiler and build properties for more information.
    • If you build at the command line, look at the linker options specified there.
    • If you build with build scripts, look through your scripts to see where these linker options are being specified.

    When you find where the mutually exclusive linker options are specified, remove one of the linker options.

    Some specific examples:
    • If you link a module that was compiled with /ZI, which implies an internal linker option called /EDITANDCONTINUE, and a module that was compiled with /OPT:REF, /OPT:ICF, or /INCREMENTAL:NO, which imply no /EDITANDCONTINUE, you will get LNK4075. See /Z7, /Zi, /ZI (Debug Information Format) for more information.
  5. /Z7, /Zi, /ZI (Debug Information Format)
  6. Compiler options listed by category
  7. Compiler Options
  8. Visual Studio 2005 - Warning LNK 4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
  9. The above warning occurs as a result of a clash between two features of the Visual Studio development suite and can be eliminated by either disabling support for "Edit and Continue" or eliminating Incremental Compilation. The first allows you to edit code while debugging when stopped at a break point. The second specifies whether linking is done incrementally or not (that is, one included library at a time). Linking incrementally can result in larger file sizes and occassionally "jump thunks," which, I believe, are libraries that require multiple memory hops to reach.

    If you link a module that was compiled with /ZI, which implies an internal linker option called /EDITANDCONTINUE, and a module that was compiled with /OPT:REF, /OPT:ICF, or /INCREMENTAL:NO, which imply no /EDITANDCONTINUE, you will get LNK4075.

    The property controlling "edit and continue" can be changed in the Project Properties Pages -> Project Configuration -> C/C++ -> Debug Information Format, whereas the property specifies if linking should be done incrementally can be changed in the Project Properties Pages -> Project Configuration -> Linker -> Enable Incremental Linking.

No comments:

Post a Comment