Export (0) Print
Expand All

/Yl (Inject PCH Reference for Debug Library)

/Ylsymbol

where:

symbol
An arbitrary symbol to be stored in the object module. For usage details, see the Remarks.

Remarks

When you compile a module with /Yc and /Ylsymbol, the compiler creates a symbol similar to __@@_PchSym_@00@...@symbol, where the ellipsis (...) represents a linker-generated character string, and stores it in the object module. Any source file that you compile with this precompiled header refers to the specified symbol, which causes the linker to include the object module and its debugging information from the library.

This option is useful if you attempt to create a debugging library that uses precompiled headers and the build fails. You may generate LNK1211. When you specify the /Yc and /Z7 options, the compiler creates a precompiled header file that contains debugging information. An error can occur when you store the precompiled header in a library, use the library to build an object module, and the source code does not refer to any of the functions the precompiled header file defines.

To solve the problem, specify /Ylsymbol, where symbol is the name of an arbitrary symbol in the library, when you create a precompiled header file that does not contain any function definitions. This option directs the compiler to store the debugging information in the precompiled header file.

For more information on precompiled headers, see:

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
  2. Click the C/C++ folder.
  3. Click the Command Line property page.
  4. Type the compiler option in the Additional Options box.

To set this compiler option programmatically

See AdditionalOptions.

See Also

Compiler Options | Setting Compiler Options

Show:
© 2014 Microsoft