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

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 22:11:10

问题


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


回答1:


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.




回答2:


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.




回答3:


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)




回答4:


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.




回答5:


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




回答6:


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



来源:https://stackoverflow.com/questions/1574367/lnk4075-ignoring-editandcontinue-due-to-opticf-specification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!