7

In Visual Studio 2003, if I link with a library that doesn't have its corresponding PDB file, I get a warning:

foo.lib(bar.obj) : warning LNK4099: PDB 'other.pdb' was not found; linking object as if no debug info

If the PDBs are in their original build location VS can find them, as well as if they're in the current build directory, but that seems to be it. Is there a way I can tell Visual Studio exactly where it should look for PDBs? I have a vague notion that a symbol server might work, but that seems like a lot of overhead; I'm just looking for something like link.exe /pdbpath c:\pdbs_are_right_here that adds a path to search, like /I adds an include path. Alternately, are there other paths it searches besides the current directory and the original absolute path the PDB was written to?

Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
Michael Mrozek
  • 169,610
  • 28
  • 168
  • 175

1 Answers1

0

I believe the path to the corresponding pdb's is embedded in the libraries themselves, and you can change it into c:\pdbs_are_right_here at the build switches for your libraries (assuming they are indeed yours and not 3rd party).

For DLL's that means project properties\linker\debugging\generate program database file.

For static libraries the default name is uniform in VS2013 ('vc120.pdb'), but I think this changed in VS2015 and have no idea about VS2003. Anyway if you're working in VS2013\2012\2010 you'd have to explicitly override the name too.

Ofek Shilon
  • 14,734
  • 5
  • 67
  • 101