简体   繁体   English

在Visual Studio 2013 for C ++中进行调试时的错误代码

[英]Error codes when debugging in Visual Studio 2013 for C++

My C++ code in Visual Studio Express 2013 (code replicated from a programming book I was using) generates a whole bunch of errors too long to list here... But each error is the same problem: 我在Visual Studio Express 2013中的C ++代码(从我正在使用的编程书中复制的代码)会产生一堆错误,时间太长,无法在此处列出...但是每个错误都是相同的问题:

"Cannot find or open the PDB file." “无法找到或打开PDB文件。”

An example of one file it was trying to find/open is: C:\\Windows\\SysWOW64\\KernelBase.dll 它尝试查找/打开的一个文件的示例是: C:\\Windows\\SysWOW64\\KernelBase.dll

Anyone got any suggestions? 任何人有任何建议吗? I'm a total newbie so please use plain words! 我是一个新手,所以请用简单的词! Cheers. 干杯。

When you build a binary with VS, VS creates a program database for it. 使用VS构建二进制文件时,VS会为其创建一个程序数据库。 When debugging a process, VS searches for debug symbols next to the binary. 调试进程时,VS在二进制文件旁边搜索调试符号。

As long as you don't need these symbols (to set a breakpoint in eg WaitForSingleObject or so), you don't need the .pdb either. 只要您不需要这些符号(例如在WaitForSingleObject设置断点),您也不需要.pdb。

However, when the debugger tries to construct a call stack, it often does need the symbols (it will tell you that 'frames might not be correct'). 但是,当调试器尝试构造调用堆栈时,通常确实需要符号(它将告诉您“帧可能不正确”)。 In that case, you can tell VS to retrieve the microsoft program databases from the Microsoft Symbol Servers . 在这种情况下,您可以告诉VS从Microsoft Symbol Servers中检索Microsoft程序数据库

Note: when all this symbol-loading slows down your process, there are settings to disable automatically loading them. 注意:当所有这些符号加载减慢了您的处理速度时,有一些设置可以禁用自动加载它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM