用了VS 2010 會產生 "Cannot find or open the PDB file " 訊息...
查了一下網路上的解答,最後得到一個算是來自原廠的回答:
看來也是一位老中小姐吧:Helen Zhao ?!
---
最後還不免促銷一下新版的 VS11....天啊...還真的還要出新版的啊!
----
專業回答:
The message "Cannot find or open the PDB file" is something you don't have to worry about. If you notice all of the files that this applies to are Windows' system DLLs and other DLLs from third party components. Any problems you are getting are not a result of this message since normally you run programs without these PDB files and they mostly run OK.
So what is a PDB file, well it is a file which contains things like function names and associates them with addresses in an executable and also lines of code in a source file. If you look at the very first one in the list, your application executable, it has "Symbols Loaded" next to it. If you press f10 to start your application, notice how it goes to the first line in your main function? This is thanks to the PDB file, if you press f10 again, notice how it just steps to the next line of code? This is thanks to the PDB file. Giving you source level debugging and giving you symbols so you can get an accurate call stack is really all PDB files do.
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 and in the window that appears go to 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)".
As you probably would have guessed from the tone of this post though, this won't fix your current crashes.
This is a signature
Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.
Do you want Visual Studio 11 Express to be freely installable on Windows 7 and able to write regular C++ applications? Please vote for this.
- Proposed As Answer by Helen Zhao Microsoft Contingent Staff, Moderator Tuesday, April 03, 2012 6:52 AM