Share via


/Yd   (Place Debug Info in Object File)

OverviewHow Do ICompiler Options

This option, when used with the /Yc and /Z7 options, places complete debugging information in all object files created from a precompiled header (.PCH) file. Unless you need to distribute a library containing debugging information, use the /Zi option rather than /Z7 and /Yd. The /Yd option takes no argument.

Storing complete debugging information in every .OBJ file is necessary only to distribute libraries that contain debugging information. It slows compilation and requires considerable disk space. When /Yc and /Z7 are used without /Yd, the compiler stores common debugging information in the first .OBJ file created from the .PCH file. The compiler does not insert this information into .OBJ files subsequently created from the .PCH file; it inserts cross-references to the information. No matter how many .OBJ files use the .PCH file, only one .OBJ file contains the common debugging information.

Although this default behavior results in faster build times and reduces disk-space demands, it is undesirable if a small change requires rebuilding the .OBJ file containing the common debugging information. In this case, the compiler must rebuild all .OBJ files containing cross-references to the original .OBJ file. Also, if a common .PCH file is used by different projects, reliance on cross-references to a single .OBJ file is difficult.

Note   The /Yd option is implied with use of the Automatic Use Of Precompiled Headers (/YX) option.