Symbols missing whilst debugging?

cool_static_MTD_d.lib(Cool.obj) : warning LNK4099: PDB 'vc90.pdb' was not found with '../extras/Cool/lib\cool_static_MTD_d.lib' or at 'd:\ProjectName\Debug\vc90.pdb'; linking object as if no debug info

Are you occasionally bothered by the MSVC linker complaining about missing or bad pdb files? Are you stepping into your code, including DLLs and seeing no symbols? Here's the solution:

In all of your vcproj's Property Pages, go to the Program Database File Name setting (Configuration Properties/ C++/ Output Files), and enter the following mystery string (that tells the compiler that the pdb file goes in the intermediate directory, and to call it something like CoolnessWin32Debug.pdb):

$(IntDir)\$(ProjectName)$(PlatformName)$(ConfigurationName).pdb

If you are using libraries that you got from somewhere else, you'll need to make this fix to their vcproj's as well. Most developers seem not to know how to configure the setting, and the default that MSVC gives you is not at all helpful.

Rebuild, and the warnings and debugging problems will be a thing of the past!

programming/visual_studio

Content by Nick Porcino (c) 1990-2011