Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between /PDB and /Fd options

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?

like image 605
sigy Avatar asked Jan 19 '26 19:01

sigy


1 Answers

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.

like image 105
Hans Passant Avatar answered Jan 21 '26 08:01

Hans Passant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!