|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
/Yl (Inject PCH Reference for Debug Library)
Used if creating a debugging library that uses precompiled headers and the build fails.
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.
Using this option, you may generate LNK1211. When you specify theand 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
Open the project's Property Pages dialog box. For details, see.
Click the C/C++ folder.
Click the Command Line property page.
Type the compiler option in the Additional Options box.
To set this compiler option programmatically