Skip to content

Commit 25127d0

Browse files
author
Colin Robertson
authored
Update /Yl for clarity (MicrosoftDocs#573)
1 parent 833f566 commit 25127d0

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

docs/build/reference/yl-inject-pch-reference-for-debug-library.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "-Yl (Inject PCH Reference for Debug Library) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "12/04/2017"
4+
ms.date: "01/29/2018"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.technology: ["cpp-tools"]
@@ -18,7 +18,7 @@ ms.workload: ["cplusplus"]
1818
---
1919
# /Yl (Inject PCH Reference for Debug Library)
2020

21-
The **/Yl** option creates a common symbol for a precompiled header file and injects references to this symbol in all files that use the precompiled header. This makes the complete type information for precompiled header symbols available to the debugger in all files that use the precompiled header. This option is enabled by default. Use of this option can prevent linker errors due to missing debug information in linked libraries that use precompiled headers.
21+
The **/Yl** option generates a unique symbol in a precompiled header file, and a reference to this symbol is injected in all object files that use the precompiled header.
2222

2323
## Syntax
2424

@@ -29,20 +29,22 @@ The **/Yl** option creates a common symbol for a precompiled header file and inj
2929
### Arguments
3030

3131
*name*
32-
An optional name used to define a symbol to be stored and referenced in object files that define or use the precompiled header.
32+
An optional name used as part of the unique symbol.
3333

3434
*\-*
3535
A dash (-) explicitly disables the **/Yl** compiler option.
3636

3737
## Remarks
3838

39-
The **/Yl** option enables the debugger to get complete information about types in a precompiled header in every file that includes the precompiled header. This option creates an internal symbol name, injects the symbol definition in the object file used to create the precompiled header by the [/Yc](../../build/reference/yc-create-precompiled-header-file.md) option, and injects a reference to the symbol in all files that include the precompiled header by using the [/Yu](../../build/reference/yu-use-precompiled-header-file.md) compiler option. Because all source files that use the precompiled header refer to the named symbol, the linker always links the object file that defines the symbol and the associated precompiled header debugging information. This option is enabled by default.
39+
The **/Yl** compiler option creates a unique symbol definition in a precompiled header file created by using the [/Yc](../../build/reference/yc-create-precompiled-header-file.md) option. References to this symbol are automatically injected in all files that include the precompiled header by using the [/Yu](../../build/reference/yu-use-precompiled-header-file.md) compiler option. The **/Yl** option is enabled by default when **/Yc** is used to create a precompiled header file.
4040

41-
The **/Yl**_name_ option is used to explicitly create the identifying symbol for the precompiled header file. The compiler uses the *name* argument to create a symbol similar to \_\_@@\_PchSym\_@00@...@*name*, where the ellipsis (...) represents a linker-generated character string. If the argument is omitted, the compiler generates a symbol name automatically.
41+
The **/Yl**_name_ option is used to create an identifiable symbol in the precompiled header file. The compiler uses the *name* argument as part of the decorated symbol name it creates, similar to \_\_@@\_PchSym\_@00@...@*name*, where the ellipsis (...) represents a unique compiler-generated character string. If the *name* argument is omitted, the compiler generates a symbol name automatically. Normally, you do not need to know the name of the symbol. However, when your project uses more than one precompiled header file, the **/Yl**_name_ option may be useful to determine which object files use which precompiled header. You can use *name* as a search string to find the symbol reference in a dump file.
4242

43-
**/Yl-** disables the default behavior and does not put an identifying symbol reference in the object files that include the precompiled header. This option may be required for files compiled without the precompiled header file present.
43+
**/Yl-** disables the default behavior and does not put an identifying symbol in the precompiled header file. Compiled files that include this precompiled header do not get a common symbol reference.
4444

45-
If you use **/Yl-**, **/Yc** and [/Z7](../../build/reference/z7-zi-zi-debug-information-format.md) options to build a library, the compiler creates a precompiled header file that contains debugging information that is stored in an object file rather than a .pdb file. [LNK1211](../../error-messages/tool-errors/linker-tools-error-lnk1211.md) errors or [LNK4206](../../error-messages/tool-errors/linker-tools-warning-lnk4206.md) warnings can occur in builds that use this library and the precompiled header if the source file used to create the precompiled header does not define any symbols. The linker may exclude this library object file from the link, along with the associated precompiled header debug information, when nothing in the object file is referenced in the library client. To solve the problem, specify **/Yl** when you use **/Yc** to create a precompiled header file and **/Yu** to use it. This ensures that the object file that contains the debugging information is included in your build.
45+
When **/Yc** is not specified, any **/Yl** option has no effect, but if specified it must match any **/Yl** option passed when **/Yc** is specified.
46+
47+
If you use **/Yl-**, **/Yc** and [/Z7](../../build/reference/z7-zi-zi-debug-information-format.md) options to build a precompiled header file, the debugging information is stored in the object file for the source file used to create the precompiled header, rather than a separate .pdb file. If this object file is then made part of a library, [LNK1211](../../error-messages/tool-errors/linker-tools-error-lnk1211.md) errors or [LNK4206](../../error-messages/tool-errors/linker-tools-warning-lnk4206.md) warnings can occur in builds that use this library and the precompiled header file, if the source file used to create the precompiled header file does not define any symbols itself. The linker may exclude the object file from the link, along with the associated debugging information, when nothing in the object file is referenced in the library client. To solve this problem, specify **/Yl** (or remove the **/Yl-** option) when you use **/Yc** to create the precompiled header file. This ensures that the object file from the library that contains the debugging information gets linked in your build.
4648

4749
For more information on precompiled headers, see:
4850

@@ -54,7 +56,7 @@ For more information on precompiled headers, see:
5456

5557
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
5658

57-
1. Choose the **Command Line** property page in the **C/C++** folder.
59+
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
5860

5961
1. Add the **/Yl**_name_ compiler option in the **Additional Options** box. Choose **OK** to save your changes.
6062

0 commit comments

Comments
 (0)