Debugging Code Compiled with /Yc or /Yu

Home

You can use either the /Zi or the /Z7 option with the /Yc and /Yu options to generate debugging information compatible with the Visual C++ debugger or CodeView.

It is recommended that you use the /Zi option unless you need /Z7 to maintain compatibility with Microsoft C/C++ version 7.0. The /Zi option places the generated debugging information into a program database (PDB); a PDB speeds linking during the debugging process. The /Yd option, which places all debugging information into every object file created using a precompiled header, is ignored unless used with /Z7.

The following table summarizes results obtained from using the /Zi, /Z7, and /Yd options in combination with /Yc and /Yu.

Results of Combining Debugging Options with /Yc or /Yu

Option Result
/Zi Debugging information for both the precompiled header and the rest of the source code is placed in a program database (PDB) with the default name of MSVC.PDB.
/Zi /Yd /Yd is ignored. Debugging information for both the precompiled header and the rest of the source code is placed in a PDB with the default name of MSVC.PDB.
/Z7 Debugging information for both the precompiled header and the rest of the source code is placed in the first object file created using the precompiled header.
/Z7 /Yd Debugging information for both the precompiled header and the rest of the source code is placed in every object file created using the precompiled header.

For more information, see The /Yd (Duplicate Debugging Information in All Object Files) Option.