There is the /Fd option for the compiler and the /PDB option for the linker. While /PDB
defaults to $(OutDir)$(TargetName).pdb
, the compiler option /Fd
defaults to $(IntDir)vc$(PlatformToolsetVersion).pdb
. Thus, two files are generated during a build. According to the documentation both are called Program Database File and both are related to debug information. What is the difference between both files?
The VCxxx.pdb file is primarily necessary for static library projects. It stores the debug info for the library. The linker needs it when it generates the final PDB file that the debugger uses, it picks the relevant debug info records for the actual functions it links into the final image.
Does some other stuff as well, murky, I think it supplies dependency info. It got more convoluted with the /Debug:FASTLINK option available since VS2015 Update 1, now it also provides debug info at runtime. Which trades the effort of generating a complete PDB, quite expensive for large projects, with the debugger spending more time to dig up the VCxxx.pdb files. Almost always a win. I never yet found a good reason to override /Fd, but always preferred default build options.