Vc80.pdb – How to make it go away and never bother me again


When building static libraries with VS2005 I keep getting linker warnings that VC80.pdb cant be found with my library.lib. Apparently, as a result, the edit and continue feature of the IDE fails to work any project that incorporates library.lib

What magic is needed to tell VS2005 to produce a static lib with edit and continue debug info that does NOT reference or require vs80.pdb when linked into a project?

–Upon Further Understanding–
So, In order to get edit-and-continue to function with a pre-compiled static lib, we need to place the vs80.pdb and vs80.pdb file into SVN along with the .lib, AND rename the pdb/idb to prevent conflicts when doing this with multiple pre-compiled libs.

Best Solution

vc80.pdb is the file that contains the debug information for your lib. In the ide Property pages:configuration properties:c\c++:output files allows you to rename this to something more appropriate, such as the name of your lib. When the linker links your lib into the target exe it looks for this pdb (there is a pointer to it in the lib) and extracts the info from that pdb and drops it in the exe's pdb.

/Fd[name] is the option for renaming the pdb /ZI is the option for compiling with a pdb that includes Edit and Continue information.

All linked libs and the final taget exe or dll need /ZI, to enable edit and continue.

I made a tiny testlib.lib and used "dumpbin /all" to get the following showing the pointer to the debug info (this is a tiny excerpt):

.debug$T name
       0 physical address
       0 virtual address
      48 size of raw data
     838 file pointer to raw data (00000838 to 0000087F)
       0 file pointer to relocation table
       0 file pointer to line numbers
       0 number of relocations
       0 number of line numbers
42100040 flags
         Initialized Data
         1 byte align
         Read Only

  00000000: 04 00 00 00 42 00 15 15 D5 EA 1E C9 7C 10 3A 40  ....B...Õê.É|.:@
  00000010: 93 63 CE 95 77 15 49 4A 03 00 00 00 64 3A 5C 64  .cÎ.w.IJ....d:\d
  00000020: 65 76 5C 74 65 73 74 5C 74 65 73 74 6C 69 62 5C  ev\test\testlib\
  00000030: 74 65 73 74 6C 69 62 5C 64 65 62 75 67 5C 76 63  testlib\debug\vc
  00000040: 38 30 2E 70 64 62 00 F1                          80.pdb.ñ
Related Question