如何确保不忽略/EDITANDCONTINUE指令 [英] How to ensure that the /EDITANDCONTINUE directive is not ignored

查看:570
本文介绍了如何确保不忽略/EDITANDCONTINUE指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试编辑并继续在VSC15中时收到此消息:

I get this message when I try to edit and continue in 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.

我已经确保启用了/INCREMENTAL,但无法弄清第二部分.

I've already ensured that /INCREMENTAL is enabled but can't figure out the second part.

编译器命令行:

/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"

链接器命令行:

/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

推荐答案

查看命令行:

编译器命令行:编辑并继续"与/Gm-并不真正兼容,它需要启用最小重建"(/Gm).

Compiler command line: Edit and Continue isn't really compatible with /Gm-, it requires "Enable Minimal Rebuild" (/Gm).

链接器命令行:/OPT:REF,/SAFESEH,/OPT:ICF均与编辑并继续"不兼容,应导致LNK4075.

Linker command line: /OPT:REF, /SAFESEH, /OPT:ICF are all incompatible with Edit and Continue and should cause LNK4075.

如果您尝试全新构建LIB.dll,则应看到诸如以下的警告:

If you try a clean build of LIB.dll, you should see warnings such as:

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

这篇关于如何确保不忽略/EDITANDCONTINUE指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆