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

    שאלה

  • 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
    יום שישי 08 ינואר 2010 12:25

תשובות

  • 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

    • סומן כתשובה על-ידי Roahn Luo יום שני 11 ינואר 2010 02:12
    יום שישי 08 ינואר 2010 22:45
  • 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
    • סומן כתשובה על-ידי Roahn Luo יום שני 11 ינואר 2010 02:12
    יום ראשון 10 ינואר 2010 20:46

כל התגובות

  • 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

    • סומן כתשובה על-ידי Roahn Luo יום שני 11 ינואר 2010 02:12
    יום שישי 08 ינואר 2010 22:45
  • 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
    • סומן כתשובה על-ידי Roahn Luo יום שני 11 ינואר 2010 02:12
    יום ראשון 10 ינואר 2010 20:46
  • 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

    יום שני 24 מאי 2010 21:42
  • what did that "answer" mean....

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

     

    שבת 14 אוגוסט 2010 22:08
  • @ Roahn Luo:

    seriously, how can downgrading be considered an answer??

    יום שני 23 אוגוסט 2010 19:45
  • 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.
    • הוצע כתשובה על-ידי tp11235 שבת 23 מרץ 2013 10:25
    יום רביעי 25 אוגוסט 2010 06:52
  • 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 .

    • הוצע כתשובה על-ידי tp11235 שבת 23 מרץ 2013 10:26
    יום רביעי 25 אוגוסט 2010 19:42
  • 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

    יום שני 08 נובמבר 2010 02:22
  • alex,

    i cannot find settings and the EXPERT setting.

    יום שני 08 נובמבר 2010 22:42
  • 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

    יום שלישי 09 נובמבר 2010 04:51
  • visual studio professional does not the settings option. they redesgned the tools menu. see my recent post.
    יום שלישי 09 נובמבר 2010 12:36
  •  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

    • הוצע כתשובה על-ידי lipje יום ראשון 02 יוני 2013 08:13
    יום שני 17 ינואר 2011 16:55
  • thanks....
    יום חמישי 03 פברואר 2011 21:10
  • You need to run Visual c++ in "Run as Administrator" mode.

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

    • הוצע כתשובה על-ידי Infernal Gear יום שני 12 נובמבר 2012 22:23
    יום שישי 18 מרץ 2011 02:07
  • 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

    • הוצע כתשובה על-ידי sunithadsouza יום רביעי 30 אוקטובר 2013 16:12
    יום רביעי 06 אפריל 2011 15:30
  • Worked perfectly. Thank you.
    • הוצע כתשובה על-ידי pnutbutr יום רביעי 08 ינואר 2014 06:55
    יום רביעי 14 ספטמבר 2011 23:01
  • 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.

    יום חמישי 06 אוקטובר 2011 01:35
  • This worked thx DUDE!
    • הוצע כתשובה על-ידי Zeineb-AB יום רביעי 07 מרץ 2012 14:37
    יום חמישי 20 אוקטובר 2011 06:43
  • 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

    יום רביעי 07 מרץ 2012 14:26
  • 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.

    יום שישי 16 מרץ 2012 10:36
  • Thanks you are a star
    יום שישי 30 מרץ 2012 10:42
  • 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)"."

    • נערך על-ידי Sergey Chepurin יום שני 02 אפריל 2012 05:15
    יום ראשון 01 אפריל 2012 10:15
  • just press ctrl+f5 this will start without debugging 

    hope this helps

    יום רביעי 04 יולי 2012 11:10
  • Thanks a lot
    יום רביעי 18 יולי 2012 10:07
  • thanks Alex.

    it works

    יום שישי 27 יולי 2012 22:45
  • 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.

    • נערך על-ידי JiveDadson יום שני 30 יולי 2012 10:41
    • הוצע כתשובה על-ידי JiveDadson יום שני 30 יולי 2012 10:48
    יום שני 30 יולי 2012 10:37
  • 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

    יום שלישי 18 ספטמבר 2012 08:22
  • 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.

    שבת 23 מרץ 2013 10:39
  • Tools>Options...>Debugging>Output Window>Set 'Module Load Messages' to 'Off' and the messages will no longer be displayed.
    יום רביעי 10 אפריל 2013 03:58
  • Thank you very very much!!!!! :D
    יום חמישי 25 יולי 2013 21:32
  • 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

    יום שלישי 06 אוגוסט 2013 01:39
  • thanks, it works
    יום שישי 23 אוגוסט 2013 00:43
  • Thank you, its work for me
    יום רביעי 23 אוקטובר 2013 16:10
  • thanks a lot for the information I was able to clarify my doubt

    יום רביעי 30 אוקטובר 2013 16:06
  • 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

    יום רביעי 30 אוקטובר 2013 16:12
  • 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?

    יום ראשון 10 נובמבר 2013 02:58
  • thanks very much............it worked........

    יום חמישי 06 פברואר 2014 10:29