Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Visual Studio 2010 not able to find/open PDB files?

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:

'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

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

like image 423
HamidRezaHamidiEsfahani Avatar asked Jan 27 '11 08:01

HamidRezaHamidiEsfahani


People also ask

How do you fix Cannot find or open the PDB file?

Try go to Tools->Options->Debugging->Symbols and select checkbox "Microsoft Symbol Servers", Visual Studio will download PDBs automatically. PDB is a debug information file used by Visual Studio. These are system DLLs, which you don't have debug symbols for.

Where does Visual Studio look for PDB files?

pdb file stores all debug information for the project's .exe file, and resides in the \debug subdirectory. The <project>. pdb file contains full debug information, including function prototypes, not just the type information found in VC<x>. pdb.

How do I open PDB files in Visual Studio?

How to open a PDB file. You can use Microsoft Visual Studio (Windows) to load information from a PDB file created by that program. This allows you to debug the program the file is associated with. You can also use Microsoft's CVDump program (Windows) to read the information a Visual Studio PDB file contains.

How do I open PDB files?

Click "File" and select "Open File" > "PDB File". Select the file, and click "Load". The 3D view of the structure you have uploaded will now be displayed.


2 Answers

First change the following parameters:

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

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

like image 161
seanlitow Avatar answered Sep 21 '22 12:09

seanlitow


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.

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.

like image 28
Cody Gray Avatar answered Sep 18 '22 12:09

Cody Gray