LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification

C++Visual StudioDllLinkerLinker Warning

C++ Problem Overview


I recently converted a multi-project Visual Studio solution to use .dlls instead of .libs for each of the projects. However, I now get a linker warning for each project as stated in the example. MSDN didn't serve to be all that helpful with this. Why is this and how can I solve it?

> Warning 2 warning LNK4075: ignoring > '/EDITANDCONTINUE' due to '/OPT:ICF' > specification LudoCamera.obj

C++ Solutions


Solution 1 - C++

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.

Solution 2 - C++

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.

Solution 3 - C++

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)

Solution 4 - C++

you should set BOTH projects 'Debug Information Format' as 'Program Database(/Zi)'. Eg. If the warning is :

>warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification D:\mypath\project1\project1.obj project2

Then in BOTH project1 and projects's properties. Set them as:

>project properties->Configuration Properties->C/C++->General->Debug Information Format, set it as ‘Program Database(/Zi)’;

Solution 5 - C++

I know what it is, they dll are not release versions. I think the linker still thinks they are debug builds, which still have the debug edit and continue functionality used when debugging still turned on.

Bob.

Solution 6 - C++

We had to set "Generate Debug Info" to "Yes (/DEBUG)" under the project properties' Linker->Debugging pane. 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.)

Solution 7 - C++

You can also get this error if you've accidentally added a debug directory into your release build. Check Linker->General->Additional Library Directories. Worked for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMarkView Question on Stackoverflow
Solution 1 - C++Lou FrancoView Answer on Stackoverflow
Solution 2 - C++RichardView Answer on Stackoverflow
Solution 3 - C++WalleView Answer on Stackoverflow
Solution 4 - C++PennyView Answer on Stackoverflow
Solution 5 - C++scope_creepView Answer on Stackoverflow
Solution 6 - C++ulatekhView Answer on Stackoverflow
Solution 7 - C++Andrew MorrisView Answer on Stackoverflow