121

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.

'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

Badda
  • 1,329
  • 2
  • 15
  • 40
user1723768
  • 1,237
  • 2
  • 9
  • 3
  • 2
    Not sure that this will solve your problem or not, but my problem solved my `Cannot find or open the PDB file` problem on Virtual C++ 2010 Express. Go to `Tools > Options > Debugging > Native` and check `Load DLL Exports` – Ari May 21 '14 at 13:01
  • 7
    Please note that the location of this option has changed as of Visual Studio 2015, it is now under `Tools > Options > Debugging > General > Load dll exports (Native only)` – Remko Duursma Jul 03 '15 at 03:27
  • **See Also**: [Error Message : Cannot find or open the PDB file](https://stackoverflow.com/q/15937707/1366033) – KyleMit May 31 '20 at 18:21

7 Answers7

254

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->Symbols and 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.

David G
  • 94,763
  • 41
  • 167
  • 253
Paul
  • 13,042
  • 3
  • 41
  • 59
  • 1
    I have the same problem I was trying to install opencv to VS12. It seemed loading the symbols but when I rebuild there is no change. Do you have another idea why this is happenning? – Ege Oct 18 '13 at 13:24
  • It worked for me but only partially. It cannot load symbols for the dlls related to openCV. Same as @Ege – Ruchir Sep 02 '15 at 09:54
  • 1
    @Ruchir You need to specify paths to OpenCV symbols in that dialog. Microsoft Symbol Servers only have symbols for Microsoft DLLs. – Paul Sep 02 '15 at 18:58
  • Thanks @Paul. I don't have OpenCV related PDB files and it seems to get them I'll have to reinstall OpenCV using cmake http://stackoverflow.com/a/19436870/5022962 . Don't want to reinstall OpenCV though.... – Ruchir Sep 03 '15 at 07:10
  • The `\Users\%Username%\AppData\Local\Temp\SymbolCache\MicrosoftPublicSymbols` is the typical location where the downloaded MS symbols are stored. During the 50 MB D/L for my project, VS10 in "hourglass" mode was never relegated by Task Manager to a "not responding state", however. – Laurie Stearn Oct 19 '15 at 03:23
  • @Frankenstein Are you seeing messages about Windows DLLs or about DLLs of your project? – Paul Feb 04 '16 at 01:46
  • it's about DLL of windows in SysWOW64 anyway i have used the solution below from @Luis Salazar and it disapeared – The Beast Feb 04 '16 at 08:40
  • With this I had to downgrade MSTest.TestAdapter.1.2.0 to 1.1.18 and MSTest.TestFramework.1.2.0 to 1.1.18 then it worked – Saurabh Raoot Apr 03 '18 at 12:21
52

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

It will disable the display of modules loaded.

Luis Salazar
  • 547
  • 4
  • 2
  • 7
    This is the better solution as It removes these lines instead of just fixing PDB unloaded files information. Upvoted. –  Aug 03 '14 at 02:37
  • 1
    Trying to do this the visual studio environment changed its visual environment :( – Alexander Leon VI Jul 10 '15 at 19:46
  • 9
    Note that this is not the solution, it just avoids the problem. – Cary Bondoc Aug 25 '15 at 02:08
  • 3
    @CaryBondoc depends what you view the problem as being... if the problem is that lots of irrelevant noise in the output can make it easy to miss actual information, then this method is better, as the other method just changes the quality of the noise by replacing `Cannot find or open the PDB file` with `Symbols loaded`. It would be nice if the output were color coded or something. Of course there's also the risk of doing this and forgetting about it when it later becomes important. Such is the life of a programmer. – PeterT Jun 14 '16 at 12:35
  • How to avoid getting this window? When I press F11 on framework method I get this annoying window. I have to be careful when to press F11 or press F10. please help – M.kazem Akhgary Feb 17 '18 at 14:50
36

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.

enter image description here

zar
  • 11,361
  • 14
  • 96
  • 178
4

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

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

Ingo
  • 5,239
  • 1
  • 30
  • 24
0

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

EM0
  • 5,369
  • 7
  • 51
  • 85
0

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.

jsl4980
  • 496
  • 2
  • 12
-2

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

rich
  • 93
  • 1
  • 1
  • 10