为什么“编辑并继续”功能在 VS2015 中不起作用? 调试器将忽略编辑,继续执行时您将看到一条错误消息,我得到以下信息
“The source file has changed. It no longer matches the version of the file used to build the application being debugged.”
最佳答案
您必须将调试信息格式设置为“Program Database for Edit and Continue (/ZI)”。如果此选项设置不正确,调试器将忽略编辑,就像修改禁用编辑和继续的文件一样。
如果您在未使用此选项编译的二进制文件中进行编辑,调试器将忽略该编辑,当您继续执行时您将看到一条错误消息“源文件已更改。它不再与用于构建被调试应用程序的文件版本匹配。”
Open the Property Pages of the project.
Under Configuration Properties -> C/C++ -> set the Debug Information Format to “Program Database for Edit and Continue (/ZI)”
Edit & Continue 仅在 VS2015 中引入,因此此选项在早期版本中不可用。
关于c++ - 调试器忽略已编辑的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31637496/