无法在 Visual Studio C++ 2010 中找到或打开 PDB 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12954821/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 16:48:34  来源:igfitidea点击:

Cannot find or open the PDB file in Visual Studio C++ 2010

c++visual-studio-2010pdb-files

提问by user1723768

I use Visual Studio 2010 C++ and my project builds without errors but when I run it I get this. I am on Windows XP.

我使用 Visual Studio 2010 C++ 并且我的项目构建没有错误,但是当我运行它时我得到了这个。我在 Windows XP 上。

'Shaders.exe': Loaded 'C:\Documents and Settings\User\My Documents\Visual Studio        2010\Projects\Shaders\Win32\Debug\Shaders.exe', Symbols loaded.
'Shaders.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB  file
'Shaders.exe': Loaded 'C:\qt-everywhere-opensource-src-4.8.3\bin\QtCored4.dll', Symbols  loaded.
'Shaders.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\msvcp100d.dll', Symbols loaded.
'Shaders.exe': Loaded 'C:\WINDOWS\system32\msvcr100d.dll', Symbols loaded.
'Shaders.exe': Loaded 'C:\qt-everywhere-opensource-src-4.8.3\bin\QtGuid4.dll', Symbols loaded.
'Shaders.exe': Loaded 'C:\WINDOWS\system32\comdlg32.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\winmm.dll', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\WINDOWS\system32\winspool.drv', Cannot find or open the PDB file
'Shaders.exe': Loaded 'C:\qt-everywhere-opensource-src-4.8.3\bin\QtOpenGLd4.dll', Symbols loaded.

Thanks

谢谢

回答by Paul

PDB is a debug information file used by Visual Studio. These are system DLLs, which you don't have debug symbols for. Go to Tools->Options->Debugging->Symbolsand select checkbox "Microsoft Symbol Servers", Visual Studio will download PDBs automatically. Or you may just ignore these warnings if you don't need to see correct call stack in these modules.

PDB 是 Visual Studio 使用的调试信息文件。这些是系统 DLL,您没有调试符号。转到Tools->Options->Debugging->Symbols并选中复选框“Microsoft Symbol Servers”,Visual Studio 将自动下载 PDB。或者,如果您不需要在这些模块中看到正确的调用堆栈,您可以忽略这些警告。

回答by Luis Salazar

Working with VS 2013.
Try the following Tools -> Options -> Debugging -> Output Window -> Module Load Messages -> Off

使用 VS 2013。
尝试以下工具 -> 选项 -> 调试 -> 输出窗口 -> 模块加载消息 -> 关闭

It will disable the display of modules loaded.

它将禁用加载的模块的显示。

回答by zar

Answer by Paul is right, I am just putting the visual to easily get there.

保罗的回答是对的,我只是把视觉效果放在那里很容易到达那里。

Go to Tools->Options->Debugging->Symbols

转到工具->选项->调试->符号

Set the checkbox marked in red and it will download the pdb files from microsoft. When you set the checkbox, it will also set a default path for the pdb files in the edit box under, you don't need to change that.

设置标记为红色的复选框,它将从微软下载 pdb 文件。当您设置该复选框时,它还会在下面的编辑框中为 pdb 文件设置默认路径,您无需更改该路径。

enter image description here

在此处输入图片说明

回答by Ingo

If you have more as one Project in your Project Map use THE SAME hard coded PathFile PDB Name in all your Sub-Projects:

如果您的项目地图中有多个项目,请在所有子项目中使用相同的硬编码 PathFile PDB 名称:

Use e.g.

使用例如

D:\Visual Studio Projects\my_app\MyFile.pdb

Dont use e.g.

不要使用例如

$(IntDir)\MyFile.pdb

in all the Sub-Projects !!!

在所有子项目中!!!

= Compiler Param /Fd

= 编译器参数 /Fd

回答by EM0

This can also happen if you don't have Modifypermissions on the symbol cache directory configured in Tools, Options, Debugging, Symbols.

如果您对工具、选项、调试、符号中配置的符号缓存目录没有修改权限,也会发生这种情况。

回答by jsl4980

I ran into a similar problem where Visual Studio (2017) said it could not find my project's PDB file. I could see the PDB file did exist in the correct path. I had to Clean and Rebuild the project, then Visual Studio recognized the PDB file and debugging worked.

我遇到了类似的问题,Visual Studio (2017) 说它找不到我项目的 PDB 文件。我可以看到 PDB 文件确实存在于正确的路径中。我必须清理并重建项目,然后 Visual Studio 识别出 PDB 文件并进行调试。

回答by rich

you just add the path of .pdb to work directory of VS!

您只需将 .pdb 的路径添加到 VS 的工作目录中即可!