为什么Visual Studio 2010不能找到/打开PDB文件?

时间:2023-01-06 11:44:14

I am trying to use OpenCV in VS 2010. I am an amateur, and I am learning first steps from the OpenCV wiki. However, when trying to debug my project, I get the following errors:

我正在尝试在VS 2010中使用OpenCV。我是一个业余爱好者,我正在从OpenCV wiki学习第一步。但是,在调试我的项目时,我得到了以下错误:

'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file 'C:\Windows\SysWOW64\kernellbase.dll', Cannot find or open the PDB file

“C:\ Windows \ SysWOW64 \ ntdll。无法找到或打开PDB文件C:\Windows\SysWOW64\kernel32。无法找到或打开PDB文件C:\Windows\SysWOW64\kernellbase。,无法找到或打开PDB文件

I have those files in the right directory, so why can't it open them? What should I do to fix the problem?

我有那些文件在正确的目录,所以为什么它不能打开它们?我该怎么解决这个问题?

10 个解决方案

#1


114  

First change the following parameters:

首先改变以下参数:

Tools -> Options -> Debugging -> Symbols -> Server -> Yes

工具->选项->调试->符号->服务器-> Yes

Then press Ctrl+F5 and you will see amazing things.

然后按Ctrl+F5,你会看到令人惊叹的东西。

#2


20  

I'm pretty sure those are warnings, not errors. Your project should still run just fine.

我很确定这些是警告,而不是错误。您的项目仍然可以正常运行。

However, since you should always try to fix compiler warnings, let's see what we can discover. I'm not at all familiar with OpenCV, and you don't link to the wiki tutorial that you're following. But it looks to me like the problem is that you're running a 64-bit version of Windows (as evidenced by the "SysWOW64" folder in the path to the DLL files), but the OpenCV stuff that you're trying is built for a 32-bit platform. So you might need to rebuild the project using CMake, as explained here.

但是,由于您应该始终尝试修复编译器警告,让我们看看可以发现什么。我对OpenCV一点都不熟悉,你也不需要链接到你正在学习的wiki教程。但在我看来,问题在于您正在运行一个64位版本的Windows(从指向DLL文件的路径中的“SysWOW64”文件夹可以看出),但是您正在尝试的OpenCV内容是为一个32位平台构建的。因此,您可能需要使用CMake重新构建项目,如本文所述。

More specifically, the files that are listed are Windows system files. PDB files contain debugging information that Visual Studio uses to allow you to step into and debug compiled code. You don't actually need the PDB files for system libraries to be able to debug your own code. But if you want, you can download the symbols for the system libraries as well. Go to the "Debug" menu, click on "Options and Settings", and scroll down the listbox on the right until you see "Enable source server support". Make sure that option is checked. Then, in the treeview to the left, click on "Symbols", and make sure that the "Microsoft Symbol Servers" option is selected. Click OK to dismiss the dialog, and then try rebuilding.

更具体地说,列出的文件是Windows系统文件。PDB文件包含调试信息,Visual Studio使用这些信息来进入并调试编译后的代码。实际上不需要系统库的PDB文件就可以调试自己的代码。但是如果您愿意,也可以下载系统库的符号。进入“调试”菜单,点击“选项和设置”,在右边滚动列表框,直到看到“启用源服务器支持”。确保选中该选项。然后,在左侧的treeview中,单击“Symbols”,并确保选择“Microsoft Symbol Servers”选项。单击OK关闭对话框,然后尝试重新构建。

#3


7  

Visual Studio Community Edition 2015

Visual Studio社区版2015

Been having this error all day. I finally fixed it by going to Tools>Import and Export Settings> Reset all options > Reset General Settings.

整天都犯这个错误。最后我通过工具>导入导出设置>重置所有选项>重置一般设置。

Once it's reset go to Tools>Options>Debugging>Symbols> -- Then Check the box next to Microsoft Symbol Servers.

一旦它被重置,就可以使用>选项>调试>符号>——然后选中微软符号服务器旁边的复选框。

Run your app in debug mode, and it will open up windows saying it's downloading Symbols for a bunch of different .dll files. Let it finish doing this.

在调试模式下运行你的应用程序,它会打开windows,说它正在为一系列不同的.dll文件下载符号。让它完成这个。

Once it completes, it should work again.

一旦它完成,它就应该再工作。

#4


3  

I had the same problem. It turns out that, compiling a project I got from someone else, I haven't set the correct StartUp project (right click on the desired startup project in the solution explorer and pick "set as StartUp Project"). Maybe this will help, cheers.

我遇到了同样的问题。事实证明,在编译别人的项目时,我没有设置正确的启动项目(在解决方案资源管理器中右键单击所需的启动项目并选择“设置为启动项目”)。也许这能帮上忙,干杯。

#5


2  

For VS2013 users who find themselves here as I did:

VS2013用户发现自己和我一样在这里:

Tools -> Options -> Debugging -> Symbols

You'll see that the Cache symbols in this directory: field is empty; you can either browse/enter the path yourself or just go ahead and click the Load all symbols button. An alert window will appear saying "Since you haven't selected a symbol-cache directory the default will be used". You'll now see C:\Users\XXXX\AppData\Local\Temp\SymbolCache in the previously empty path-field. Click Load all symbols a second time and you should be set. Hit ok, and just for the sake of diligence, clean and rebuild your solution.

您将看到这个目录:field中的缓存符号为空;您可以自己浏览/输入路径,或者直接单击Load all symbols按钮。会出现一个警告窗口,表示“由于您还没有选择符号缓存目录,因此将使用默认目录”。现在你会看到C:\Users\XXXX\AppData\Local\Temp\ SymbolCache在前面空路径字段。第二次点击载入所有的符号,你应该被设置,点击确定,为了勤奋,清理和重建你的解决方案。

#6


1  

Referring to the first thread / another possibility VS cant open or find pdb file of the process is when you have your executable running in the background. I was working with mpiexec and ran into this issue. Always check your task manager and kill any exec process that your gonna build in your project. Once I did that, it debugged or built fine.

当你在后台运行你的可执行文件时,你可以参考第一个线程/另一个可能,而不是不能打开或找到进程的pdb文件。我和mpiexec一起工作时遇到了这个问题。总是检查你的任务管理器,并杀死任何你要在你的项目中构建的执行过程。一旦我这样做了,它就会被调试或者建好。

Also, if you try to continue with the warning , the breakpoints would not be hit and it would not have the current executable

此外,如果您尝试继续使用警告,断点将不会被击中,它也没有当前可执行文件

#7


0  

I've found that these errors sometimes are from lack of permissions when compiling a project - so I run as administrator to get it to work properly.

我发现,这些错误有时是由于在编译项目时缺乏权限造成的——因此我以管理员的身份运行以使其正常工作。

#8


0  

I'm having the same warnings. I'm not sure it's a matter of 32 vs 64 bits. Just loaded the new symbols and some problems were solved, but the ones regarding OpenCV still persist. This is an extract of the output with solved vs unsolved issue:

我也有同样的警告。我不确定是32比特还是64比特。刚刚加载了新的符号,一些问题得到了解决,但关于OpenCV的问题依然存在。这是已解决与未解决问题的输出的提取:

'OpenCV_helloworld.exe': Loaded 'C:\OpenCV2.2\bin\opencv_imgproc220d.dll', Cannot find or open the PDB file

“OpenCV_helloworld。exe”:加载“C:\ OpenCV2.2 \ bin \ opencv_imgproc220d。,无法找到或打开PDB文件

'OpenCV_helloworld.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', Symbols loaded (source information stripped).

“OpenCV_helloworld。exe”:加载“C:\ WINDOWS \ system32系统\ imm32。“dll”,被加载的符号(源信息被删除)。

The code is exiting 0 in case someone will ask.

代码正在退出0,以防有人问。

The program '[4424] OpenCV_helloworld.exe: Native' has exited with code 0 (0x0).

程序的[4424]OpenCV_helloworld。exe: Native已经退出了代码0 (0x0)。

#9


0  

I had the same problem. Debugging does not work with the stuff that comes with the OpenCV executable. you have to build your own binarys.
Then enable Microsoft Symbol Servers in Debug->options and settings->debug->symbols

我遇到了同样的问题。调试不能与OpenCV可执行文件一起使用。你必须建立自己的比纳瑞斯。然后在调试->选项和设置->调试->符号中启用Microsoft符号服务器

#10


0  

I ran into the same issue. When I ran my Unit Test on C++ code, I got an error that said "Cannot find or open the PDB file".

我遇到了同样的问题。当我在c++代码上运行单元测试时,我得到一个错误,上面写着“无法找到或打开PDB文件”。

Logs

日志

When I looked at the Output log in Visual Studio, I saw that it was looking in the wrong folder. I had renamed the WinUnit folder, but something in the WinUnit code was looking for the PDB file using the old folder name. I guess they hard-coded it.

当我在Visual Studio中查看输出日志时,我发现它在错误的文件夹中查找。我重新命名了WinUnit文件夹,但是WinUnit代码中使用旧文件夹名查找PDB文件。我想他们是硬编码的。

Found the Problem

发现了问题

When I first downloaded and unzipped the WinUnit files, the main folder was called "WinUnit-1.2.0909.1". After I unzipped the file, I renamed the folder to "WinUnit" since it's easier to type during Visual Studio project setup. But apparently this broke the ability to find the PDB file, even though I setup everything according to the WinUnit documentation.

当我第一次下载并解压WinUnit文件时,主文件夹被称为“WinUnit-1.2.0909.1”。在解压文件之后,我将文件夹重命名为“WinUnit”,因为在Visual Studio项目设置期间更容易输入。但显然这破坏了查找PDB文件的能力,尽管我根据WinUnit文档设置了所有内容。

My Fix

我的解决

I changed the folder name back to the original, and it works.

我把文件夹名改回原来的文件夹,它就可以工作了。

Weird.

奇怪。

#1


114  

First change the following parameters:

首先改变以下参数:

Tools -> Options -> Debugging -> Symbols -> Server -> Yes

工具->选项->调试->符号->服务器-> Yes

Then press Ctrl+F5 and you will see amazing things.

然后按Ctrl+F5,你会看到令人惊叹的东西。

#2


20  

I'm pretty sure those are warnings, not errors. Your project should still run just fine.

我很确定这些是警告,而不是错误。您的项目仍然可以正常运行。

However, since you should always try to fix compiler warnings, let's see what we can discover. I'm not at all familiar with OpenCV, and you don't link to the wiki tutorial that you're following. But it looks to me like the problem is that you're running a 64-bit version of Windows (as evidenced by the "SysWOW64" folder in the path to the DLL files), but the OpenCV stuff that you're trying is built for a 32-bit platform. So you might need to rebuild the project using CMake, as explained here.

但是,由于您应该始终尝试修复编译器警告,让我们看看可以发现什么。我对OpenCV一点都不熟悉,你也不需要链接到你正在学习的wiki教程。但在我看来,问题在于您正在运行一个64位版本的Windows(从指向DLL文件的路径中的“SysWOW64”文件夹可以看出),但是您正在尝试的OpenCV内容是为一个32位平台构建的。因此,您可能需要使用CMake重新构建项目,如本文所述。

More specifically, the files that are listed are Windows system files. PDB files contain debugging information that Visual Studio uses to allow you to step into and debug compiled code. You don't actually need the PDB files for system libraries to be able to debug your own code. But if you want, you can download the symbols for the system libraries as well. Go to the "Debug" menu, click on "Options and Settings", and scroll down the listbox on the right until you see "Enable source server support". Make sure that option is checked. Then, in the treeview to the left, click on "Symbols", and make sure that the "Microsoft Symbol Servers" option is selected. Click OK to dismiss the dialog, and then try rebuilding.

更具体地说,列出的文件是Windows系统文件。PDB文件包含调试信息,Visual Studio使用这些信息来进入并调试编译后的代码。实际上不需要系统库的PDB文件就可以调试自己的代码。但是如果您愿意,也可以下载系统库的符号。进入“调试”菜单,点击“选项和设置”,在右边滚动列表框,直到看到“启用源服务器支持”。确保选中该选项。然后,在左侧的treeview中,单击“Symbols”,并确保选择“Microsoft Symbol Servers”选项。单击OK关闭对话框,然后尝试重新构建。

#3


7  

Visual Studio Community Edition 2015

Visual Studio社区版2015

Been having this error all day. I finally fixed it by going to Tools>Import and Export Settings> Reset all options > Reset General Settings.

整天都犯这个错误。最后我通过工具>导入导出设置>重置所有选项>重置一般设置。

Once it's reset go to Tools>Options>Debugging>Symbols> -- Then Check the box next to Microsoft Symbol Servers.

一旦它被重置,就可以使用>选项>调试>符号>——然后选中微软符号服务器旁边的复选框。

Run your app in debug mode, and it will open up windows saying it's downloading Symbols for a bunch of different .dll files. Let it finish doing this.

在调试模式下运行你的应用程序,它会打开windows,说它正在为一系列不同的.dll文件下载符号。让它完成这个。

Once it completes, it should work again.

一旦它完成,它就应该再工作。

#4


3  

I had the same problem. It turns out that, compiling a project I got from someone else, I haven't set the correct StartUp project (right click on the desired startup project in the solution explorer and pick "set as StartUp Project"). Maybe this will help, cheers.

我遇到了同样的问题。事实证明,在编译别人的项目时,我没有设置正确的启动项目(在解决方案资源管理器中右键单击所需的启动项目并选择“设置为启动项目”)。也许这能帮上忙,干杯。

#5


2  

For VS2013 users who find themselves here as I did:

VS2013用户发现自己和我一样在这里:

Tools -> Options -> Debugging -> Symbols

You'll see that the Cache symbols in this directory: field is empty; you can either browse/enter the path yourself or just go ahead and click the Load all symbols button. An alert window will appear saying "Since you haven't selected a symbol-cache directory the default will be used". You'll now see C:\Users\XXXX\AppData\Local\Temp\SymbolCache in the previously empty path-field. Click Load all symbols a second time and you should be set. Hit ok, and just for the sake of diligence, clean and rebuild your solution.

您将看到这个目录:field中的缓存符号为空;您可以自己浏览/输入路径,或者直接单击Load all symbols按钮。会出现一个警告窗口,表示“由于您还没有选择符号缓存目录,因此将使用默认目录”。现在你会看到C:\Users\XXXX\AppData\Local\Temp\ SymbolCache在前面空路径字段。第二次点击载入所有的符号,你应该被设置,点击确定,为了勤奋,清理和重建你的解决方案。

#6


1  

Referring to the first thread / another possibility VS cant open or find pdb file of the process is when you have your executable running in the background. I was working with mpiexec and ran into this issue. Always check your task manager and kill any exec process that your gonna build in your project. Once I did that, it debugged or built fine.

当你在后台运行你的可执行文件时,你可以参考第一个线程/另一个可能,而不是不能打开或找到进程的pdb文件。我和mpiexec一起工作时遇到了这个问题。总是检查你的任务管理器,并杀死任何你要在你的项目中构建的执行过程。一旦我这样做了,它就会被调试或者建好。

Also, if you try to continue with the warning , the breakpoints would not be hit and it would not have the current executable

此外,如果您尝试继续使用警告,断点将不会被击中,它也没有当前可执行文件

#7


0  

I've found that these errors sometimes are from lack of permissions when compiling a project - so I run as administrator to get it to work properly.

我发现,这些错误有时是由于在编译项目时缺乏权限造成的——因此我以管理员的身份运行以使其正常工作。

#8


0  

I'm having the same warnings. I'm not sure it's a matter of 32 vs 64 bits. Just loaded the new symbols and some problems were solved, but the ones regarding OpenCV still persist. This is an extract of the output with solved vs unsolved issue:

我也有同样的警告。我不确定是32比特还是64比特。刚刚加载了新的符号,一些问题得到了解决,但关于OpenCV的问题依然存在。这是已解决与未解决问题的输出的提取:

'OpenCV_helloworld.exe': Loaded 'C:\OpenCV2.2\bin\opencv_imgproc220d.dll', Cannot find or open the PDB file

“OpenCV_helloworld。exe”:加载“C:\ OpenCV2.2 \ bin \ opencv_imgproc220d。,无法找到或打开PDB文件

'OpenCV_helloworld.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', Symbols loaded (source information stripped).

“OpenCV_helloworld。exe”:加载“C:\ WINDOWS \ system32系统\ imm32。“dll”,被加载的符号(源信息被删除)。

The code is exiting 0 in case someone will ask.

代码正在退出0,以防有人问。

The program '[4424] OpenCV_helloworld.exe: Native' has exited with code 0 (0x0).

程序的[4424]OpenCV_helloworld。exe: Native已经退出了代码0 (0x0)。

#9


0  

I had the same problem. Debugging does not work with the stuff that comes with the OpenCV executable. you have to build your own binarys.
Then enable Microsoft Symbol Servers in Debug->options and settings->debug->symbols

我遇到了同样的问题。调试不能与OpenCV可执行文件一起使用。你必须建立自己的比纳瑞斯。然后在调试->选项和设置->调试->符号中启用Microsoft符号服务器

#10


0  

I ran into the same issue. When I ran my Unit Test on C++ code, I got an error that said "Cannot find or open the PDB file".

我遇到了同样的问题。当我在c++代码上运行单元测试时,我得到一个错误,上面写着“无法找到或打开PDB文件”。

Logs

日志

When I looked at the Output log in Visual Studio, I saw that it was looking in the wrong folder. I had renamed the WinUnit folder, but something in the WinUnit code was looking for the PDB file using the old folder name. I guess they hard-coded it.

当我在Visual Studio中查看输出日志时,我发现它在错误的文件夹中查找。我重新命名了WinUnit文件夹,但是WinUnit代码中使用旧文件夹名查找PDB文件。我想他们是硬编码的。

Found the Problem

发现了问题

When I first downloaded and unzipped the WinUnit files, the main folder was called "WinUnit-1.2.0909.1". After I unzipped the file, I renamed the folder to "WinUnit" since it's easier to type during Visual Studio project setup. But apparently this broke the ability to find the PDB file, even though I setup everything according to the WinUnit documentation.

当我第一次下载并解压WinUnit文件时,主文件夹被称为“WinUnit-1.2.0909.1”。在解压文件之后,我将文件夹重命名为“WinUnit”,因为在Visual Studio项目设置期间更容易输入。但显然这破坏了查找PDB文件的能力,尽管我根据WinUnit文档设置了所有内容。

My Fix

我的解决

I changed the folder name back to the original, and it works.

我把文件夹名改回原来的文件夹,它就可以工作了。

Weird.

奇怪。