In VS2012, I'm statically linking with a precompiled .lib, and need to also use that lib's .pdb file for debugging. How can I tell the linker that it should use that external pdb file?
Asked
Active
Viewed 971 times
1 Answers
1
If you created the static lib with /ZI or /Zi (see project settings for C/C++ -> General -> Debug Information Format), then the $(IntDir)vc$(PlatformToolsetVersion).pdb file is created. The path is defined by /Fd.
A linker that uses the static library usually also refers to this pdb file. If you link an executable with the static lib and the linker can't find the pdb file you should get the error like this
LNK4099: PDB 'vc1xx.pdb' was not found with 'foo.lib(foo.obj)
So what you want is the default. You may turn on verbose linking to see what happens to your symbols.
Microsoft always ships a PDB file with their static libraries named the same way like the static lib. So you find a libcmt.lib and a libcmt.pdb
-
How do you turn on verbose linking? edit: add `/verbose` to linker command line in project properties – TankorSmash Dec 09 '18 at 01:17