How to verify that the / EDITANDCONTINUE directive is not ignored

I get this message when I try to change and continue to VSC15:

'file.cpp' in 'LIB.DLL' was not linked with Edit and Continue enabled. 
Ensure that /INCREMENTAL linking is enabled, and the /EDITANDCONTINUE directive is not ignored.

I have already made sure that it is /INCREMENTALturned on, but cannot determine the second part.

Compiler Command Line:

/Yu"stdfx.h" /GS /analyze- /W3 /Gy /Zc:wchar_t /ZI /Gm- /Od /Fd".\Debug\vc140.pdb" /Zc:inline /fp:fast /D "x86" /D "WIN32" /D "_WINDOWS" /D "DEBUG" /D "_UNICODE" /D "UNICODE" /D "_WINDLL" /errorReport:none /WX- /Zc:forScope /RTC1 /GR /Gd /Oy- /MTd /Fa".\Debug\" /EHsc /Fo".\Debug\" /Fp".\Debug\LIB.pch"

Linker Command Line:

/OUT:".\Debug\LIB.dll" /MANIFEST:NO /NXCOMPAT /PDB:".\Debug\LIB.pdb" /DYNAMICBASE /DEF:"EXPORT.DEF" /IMPLIB:".\Debug\LIB.lib" /DLL /MACHINE:X86 /NODEFAULTLIB:"libc.lib" /OPT:REF /SAFESEH /INCREMENTAL /PGD:".\Debug\LIB.pgd" /SUBSYSTEM:WINDOWS /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:".\Debug\LIB.dll.intermediate.manifest" /MAP /OPT:ICF
+3
source share
4 answers

Looking at the command lines:

Compiler command line: Editing and continuing is actually not compatible with / Gm -, this requires "Enable minimal rebuild" (/ Gm).

Command line Linker: / OPT: REF, / SAFESEH, / OPT: ICF are incompatible with Edit and Continue and must call LNK4075.

LIB.dll, , :

1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification
1>ConsoleApplication1.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
+6

SAFESEH .

/SafeSEH:

+1

vs2015 https://blogs.msdn.microsoft.com/vcblog/2016/07/01/c-edit-and-continue-in-visual-studio-2015-update-3/ https://blogs.msdn.microsoft.com/vcblog/2013/10/29/the-visual-c-linker-best-practices-developer-iteration/

, - , ,

/LTCG

is enabled by default, so I had to manually add it manually with an additional linker in each project of my solution

/ LTCG: OFF

0
source

I had the same problem, all the steps above, but not luck.

I am using VS2017.

The following helped: you should specify / ZI for each specific * .cpp file in your project:

  • right-click the * .cpp file in Solution Explorer
  • Properties> C / C ++> General> Debugging Format = Database of Editing and Continuing Programs (/ ZI)
0
source

Source: https://habr.com/ru/post/1599825/


All Articles