none
C++: "Cannot find or open the PDB file"

    Question

  • Hello all,

    I just installed visual studio 2010 beta 2 on my machine (windows 7).

    I try to run a very basic and short C++ "Win32 Console Application" project. The program runs and prints results, however, i got these messages on the output window:

    'training.exe': Loaded 'G:\Users\chengtie\Documents\Visual Studio 2010\Projects\training\Debug\training.exe', Symbols loaded.
    'training.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
    'training.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
    'training.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
    'training.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
    'training.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
    The program '[2244] training.exe: Native' has exited with code 0 (0x0).

    Does anyone knows if the messages "Cannot find or open the PDB file" are nomal? Is there a way to avoid them?

    Thank you very much

    Tie CHENG
    Friday, January 08, 2010 12:25 PM

Answers

  • Hi,

     

    I assume you are not trying to load symbols from any public server, so this is expected.

    That means that for each particular dll that VS is using while running you code, VS will try to load the symbols and since you do not have the corresponding pdb files for all dlls, then this message.

    Some external dlls have symbol because the OS has them.

     

    If you are interested for a particular dll, you can look, while in debug mode, in the callstack or modules window context menus at the “Symbol load information” option.

     

    hope that this helps.

    Alina

    • Marked as answer by Roahn Luo Monday, January 11, 2010 2:12 AM
    Friday, January 08, 2010 10:45 PM
  • Hello,

    I tried the same program with Virutal Studio 2008 90 days Trial and Virtual Studio 2008 Express, there was no error...

    So i finally use Virtual Studio 2008 90 days Trial...

    Thanks and regards

    Tie
    • Marked as answer by Roahn Luo Monday, January 11, 2010 2:12 AM
    Sunday, January 10, 2010 8:46 PM

All replies

  • Hi,

     

    I assume you are not trying to load symbols from any public server, so this is expected.

    That means that for each particular dll that VS is using while running you code, VS will try to load the symbols and since you do not have the corresponding pdb files for all dlls, then this message.

    Some external dlls have symbol because the OS has them.

     

    If you are interested for a particular dll, you can look, while in debug mode, in the callstack or modules window context menus at the “Symbol load information” option.

     

    hope that this helps.

    Alina

    • Marked as answer by Roahn Luo Monday, January 11, 2010 2:12 AM
    Friday, January 08, 2010 10:45 PM
  • Hello,

    I tried the same program with Virutal Studio 2008 90 days Trial and Virtual Studio 2008 Express, there was no error...

    So i finally use Virtual Studio 2008 90 days Trial...

    Thanks and regards

    Tie
    • Marked as answer by Roahn Luo Monday, January 11, 2010 2:12 AM
    Sunday, January 10, 2010 8:46 PM
  • I use 2010, faced the same problems. I figure that out, try this:

    http://blogs.msdn.com/b/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx

    Monday, May 24, 2010 9:42 PM
  • what did that "answer" mean....

    the pdb file is genterated by the debugger....why doesn't it know where it is.

     

    Saturday, August 14, 2010 10:08 PM
  • @ Roahn Luo:

    seriously, how can downgrading be considered an answer??

    Monday, August 23, 2010 7:45 PM
  • Please check if the setting Generate Debug Info is Yes which under Project Propeties > Configuration Properties > Linker > Debugging tab. If not, try to change it to Yes.

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Proposed as answer by tp11235 Saturday, March 23, 2013 10:25 AM
    Wednesday, August 25, 2010 6:52 AM
  • Those perticular pdb's ( for ntdll.dll, mscoree.dll, kernel32.dll, etc ) are for the windows API and shouldn't be needed for simple apps.

    However, if you cannot find pdb's for your own compiled projects, I suggest making sure the Project Properties > Configuration Properties > Debugging > Working Directory uses the value from Project Properties > Configuration Properties > General > Output Directory .

    • Proposed as answer by tp11235 Saturday, March 23, 2013 10:26 AM
    Wednesday, August 25, 2010 7:42 PM
  • HI,

    the problem is with the initial setting of visual studio 2010 which is the "BASIC" setting that tend to cause such problems.

    the following have solve the same problem that is posted above :

    open visual studio

    go to tools ->settings then change to EXPERT setting

    then when you want to excute your program go to Debug--> STAR WITHOUT DEBUGGING 

    that should excute you program.

    Alex

    Monday, November 08, 2010 2:22 AM
  • alex,

    i cannot find settings and the EXPERT setting.

    Monday, November 08, 2010 10:42 PM
  • hi,

    in visual 2010 express the TOOLS is next to the DEBUG icon from the right.

    so click on tools --> then Drug the cursor to SETTINGS --> then you will find basic and expert .

    shoose expert.

    alex

    Tuesday, November 09, 2010 4:51 AM
  • visual studio professional does not the settings option. they redesgned the tools menu. see my recent post.
    Tuesday, November 09, 2010 12:36 PM
  •  go to tools ->options ->debugging->symbols->tick the check mark against microsoft symbol server and click ok

    and debug with the option start without Debugging.

    hope it helps.

    suhel

    • Proposed as answer by lipje Sunday, June 02, 2013 8:13 AM
    Monday, January 17, 2011 4:55 PM
  • thanks....
    Thursday, February 03, 2011 9:10 PM
  • You need to run Visual c++ in "Run as Administrator" mode.

    Right click on the executable and click "Run as Administrator"

    • Proposed as answer by Infernal Gear Monday, November 12, 2012 10:23 PM
    Friday, March 18, 2011 2:07 AM
  • i was tryied all the solution but i have the same error when i was Debugging
    'fluxcam.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
    'fluxcam.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
    'fluxcam.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file
    'fluxcam.exe': Loaded 'C:\OpenCV2.2\bin\opencv_highgui220d.dll', Cannot find or open the PDB file
    'fluxcam.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file
    when i build the project i have this warning
    c:\opencv2.2\include\opencv2\flann\logger.h(66): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen'

    i have vs 2O1O
     please if you can help me its so importante thanks

    • Proposed as answer by sunithadsouza Wednesday, October 30, 2013 4:12 PM
    Wednesday, April 06, 2011 3:30 PM
  • Worked perfectly. Thank you.
    • Proposed as answer by pnutbutr Wednesday, January 08, 2014 6:55 AM
    Wednesday, September 14, 2011 11:01 PM
  • Hi Cheng, 

    I got the same problem but figured it out what was wrong. 

    You are writing a Natbui;ice C++ programme I suppose, so then all you have to do is 

    Project >> Properties Menu or ALT+F7#Then select the General options under configuration Properties. 

    The Character Set Property should be NOT SET, select it from the drop down menu, apply and Ok. 

    This may build the solution  without errors.

    Snappikz.

    Thursday, October 06, 2011 1:35 AM
  • This worked thx DUDE!
    • Proposed as answer by Zeineb-AB Wednesday, March 07, 2012 2:37 PM
    Thursday, October 20, 2011 6:43 AM
  • I tried all the solution but i still find these  errors :

    .....................................

    'test.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file 

    'test.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file

    'test.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file

    .....................................

    I need help please thanks

    Wednesday, March 07, 2012 2:26 PM
  • The "The Character Set Property should be NOT SET" solution depends on whether you are using unicode in your main function or not. This type of problem can easily be solved by choosing the appropriate main function for your cause.

    However, the error "Cannot find or open the PDB file" is likely caused by yourself: Like you started an empty project instead of using a template. Since you started an empty project, VC assmues you know what you are doing and are capable of selecting your own debugging options. Anyway, try the following: 

    Goto debug - options and settings - symbols and select whatever options that enable VC to parse the .pdb module files from Microsoft Symbol Servers or choose the folders manually. If your building a win32 project, i recommend you use the microsoft servers.

    Hope this helps.

    Friday, March 16, 2012 10:36 AM
  • Thanks you are a star
    Friday, March 30, 2012 10:42 AM
  • Even though many people do not need ntdll.dll, kernel32.dll, etc symbol information, used mostly for kernel mode debugging, does not mean they have to wonder what to do receiving messages - "Cannot find or open the PDB file"

    Use this solution (from http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvc/thread/24b25003-b37b-4e08-be4d-5a23fa6e482b)

    "If you want to get rid of most of these messages you can get debugging symbols for most of these DLLs, but it won't give you access to the Windows source. If you go to Tools->Options->Debugging->Symbols and check Microsoft Symbol Server and in the Cache symbols in this directory text box below, enter a path to an empty directory where you want to cache these symbols. Be warned that this can get big and the first time one of these loads there can be a pause because it will have to download from the internet. If you do this right, most of the "Cannot find or open the PDB file" will change to "Symbols loaded (source information stripped)"."

    Sunday, April 01, 2012 10:15 AM
  • just press ctrl+f5 this will start without debugging 

    hope this helps

    Wednesday, July 04, 2012 11:10 AM
  • Thanks a lot
    Wednesday, July 18, 2012 10:07 AM
  • thanks Alex.

    it works

    Friday, July 27, 2012 10:45 PM
  • The only problem here is that the message is inscrutable to a novice, (or to an old silverback like myself who forgot what a PDB file is), and it is unnecessarily scary. There is no error.  Anyone who needs symbols for ntdll or the others knows how to load them. Pretend the message was "Symbols not loaded," and ignore it.

    • Edited by JiveDadson Monday, July 30, 2012 10:41 AM
    • Proposed as answer by JiveDadson Monday, July 30, 2012 10:48 AM
    Monday, July 30, 2012 10:37 AM
  • Hey Alex,   I installed visual c++ 2010 express and got them messages saying it could not find *.pdb files.   I tried all the suggestions except the one just above your response.

    However, if you cannot find pdb's for your own compiled projects, I suggest making sure the Project Properties > Configuration Properties > Debugging > Working Directoryuses the value from Project Properties > Configuration Properties > General > Output Directory .

    The values were indeed different in both directories and I will try this at another time.  I saw your response and said wowwwwwwwww have not seen this one before and sure enough it solve this problem of my window always closing as soon as I responded to a query in my program.

    Thanks a million.   Your solution was so simple and clean.

    I have my own copy of Visual Studio 6.0 Professional Edition.   Can I install this side by side with Visual C++ 2010 express??

                       thanx again,    Joe

    Tuesday, September 18, 2012 8:22 AM
  • It is looking for debug information for standard libraries. You could argue that it is unnecessary - unless you are doing some really difficult debugging that needs access to standard MS stuff. However, I know how annoying it is to get errors and warnings even if they don't matter!

    I have UpVoted a couple of replies that helped me. However, I think this will solve your problem:

    Tools - Options - Debugging - Symbols 

    This brings up a dialogue box. Check the box for Microsoft Symbol Servers. Then create a suitable local directory for cacheing the files when they get downloaded so that it does it only once. The first time you do this it will take time for the download.

    Build and Debug. Now you will get a report that the files were loaded.

    Hope this helps.

    Saturday, March 23, 2013 10:39 AM
  • Tools>Options...>Debugging>Output Window>Set 'Module Load Messages' to 'Off' and the messages will no longer be displayed.
    Wednesday, April 10, 2013 3:58 AM
  • Thank you very very much!!!!! :D
    Thursday, July 25, 2013 9:32 PM
  • thanks! this works for me. by using Microsoft Symbol Servers, I eliminated the PDB not loaded for ntdll.dll, kernel32.dll, KernelBase.dll, msvcp100d.dll,...

    However, I think I would try the manual folder setting since it's a bit slow for the other choice. But I'm using OpenCV and the PDB not loaded still occurs on other library opencv_core242d.dll, opencv_calib3d242d.dll

    Tuesday, August 06, 2013 1:39 AM
  • thanks, it works
    Friday, August 23, 2013 12:43 AM
  • Thank you, its work for me
    Wednesday, October 23, 2013 4:10 PM
  • thanks a lot for the information I was able to clarify my doubt

    Wednesday, October 30, 2013 4:06 PM
  • go to debug ->options and Settings ->Symbols  and selected the Microsoft servers

    this worked fine for me you can also try this as this worked out for me

    Wednesday, October 30, 2013 4:12 PM
  • Thanks TomThoros,

    It works by "The Character Set Property should be NOT SET" .

    But my program runs and give me "The program '[10408] SimpleCOM.exe' has exited with code 0 (0x0)."

    Do you know why this happens?

    Sunday, November 10, 2013 2:58 AM
  • thanks very much............it worked........

    Thursday, February 06, 2014 10:29 AM