开发者

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

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 '/EDITANDCONTINU开发者_JS百科E' due to '/OPT:ICF' specification LudoCamera.obj


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.


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.


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)


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)’;


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.


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.)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜