Skip to content

Commit 4eb7c55

Browse files
authored
Update /wholearchive command documentation to be more like other commands
Examples of arguments given
1 parent 4ad6bd6 commit 4eb7c55

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

docs/build/reference/wholearchive-include-all-library-object-files.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,23 @@ ms.assetid: ee92d12f-18af-4602-9683-d6223be62ac9
77

88
Force the linker to include all object files in the static library in the linked executable.
99

10-
## Syntax
10+
## Arguments
11+
12+
```
13+
/WHOLEARCHIVE
14+
```
15+
The default behavior is to force the linker to include every object file from all static libraries specified to the LINK command.
16+
17+
```
18+
/WHOLEARCHIVE[:library]
19+
```
20+
The linker includes every object file from the specified static library.
21+
1122

12-
> /WHOLEARCHIVE[:*library*]
1323

1424
## Remarks
1525

16-
The /WHOLEARCHIVE option forces the linker to include every object file from either a specified static library, or if no library is specified, from all static libraries specified to the LINK command. To specify the /WHOLEARCHIVE option for multiple libraries, you can use more than one /WHOLEARCHIVE switch on the linker command line. By default, the linker includes object files in the linked output only if they export symbols referenced by other object files in the executable. The /WHOLEARCHIVE option makes the linker treat all object files archived in a static library as if they were specified individually on the linker command line.
26+
The /WHOLEARCHIVE option forces the linker to include *every object file* from either a specified static library, or if no library is specified, from all static libraries specified to the LINK command. To specify the /WHOLEARCHIVE option for multiple libraries, you can use more than one /WHOLEARCHIVE switch on the linker command line. By default, the linker includes object files in the linked output only if they export symbols referenced by other object files in the executable. The /WHOLEARCHIVE option makes the linker treat all object files archived in a static library as if they were specified individually on the linker command line.
1727

1828
The /WHOLEARCHIVE option can be used to re-export all the symbols from a static library. This allows you to make sure that all of your library code, resources, and metadata are included when you create a component from more than one static library. If you see warning LNK4264 when you create a static library that contains Windows Runtime components for export, use the /WHOLEARCHIVE option when linking that library into another component or app.
1929

0 commit comments

Comments
 (0)