You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Learn more about: .Ilk Files as Linker Input"
3
-
title: ".Ilk Files as Linker Input"
4
-
ms.date: "11/04/2016"
5
-
helpviewer_keywords: ["ILK files", ".ilk files"]
2
+
description: "Learn more about: .ilk files as linker input"
3
+
title: ".ilk files as linker input"
4
+
ms.date: 09/07/2022
5
+
helpviewer_keywords: [".ilk files", ".ilk files"]
6
6
ms.assetid: 7324c104-9e5d-423d-b268-b59f92607bf2
7
7
---
8
-
# .Ilk Files as Linker Input
8
+
# `.ilk` files as linker input
9
9
10
-
When linking incrementally, LINK updates the .ilk status file that it created during the first incremental link. This file has the same base name as the .exe file or the .dll file, and it has the extension .ilk. During subsequent incremental links, LINK updates the .ilk file. If the .ilk file is missing, LINK performs a full link and creates a new .ilk file. If the .ilk file is unusable, LINK performs a nonincremental link. For details about incremental linking, see the [Link Incrementally (/INCREMENTAL)](incremental-link-incrementally.md) option.
10
+
The linker creates and uses a *`.ilk`* database file for incremental link information.
11
+
12
+
## Remarks
13
+
14
+
When linking incrementally, LINK updates the *`.ilk`* status file that it created during the first incremental link. This file has the same base name as the target EXE or DLL file, and it has the extension *`.ilk`*. During subsequent incremental links, LINK updates the *`.ilk`* file. If the *`.ilk`* file is missing, LINK performs a full link and creates a new *`.ilk`* file. If the *`.ilk`* file is unusable, LINK performs a non-incremental link. For more information about incremental linking, see the [`/INCREMENTAL` (Link incrementally)](incremental-link-incrementally.md) linker option. For information about how to specify the name and location of the file, see [`/ILK` (Name incremental database file)](./ilk-name-incremental-database-file.md).
helpviewer_keywords: ["Name incremental database file in C++ linker", "/ILK linker option", "-ILK linker option", "ILK linker option"]
7
+
---
8
+
# `/ILK` (Name incremental database file)
9
+
10
+
The **`/ILK`** linker option tells the linker where to put the *`.ilk`* database file for incremental link information ([`/INCREMENTAL`](./incremental-link-incrementally.md)).
11
+
12
+
## Syntax
13
+
14
+
> **`/ILK:`**\[*`pathname`*]
15
+
16
+
### Arguments
17
+
18
+
*`pathname`*\
19
+
The destination directory and filename for the generated *`.ilk`* file. If the **`/ILK`** option isn't specified when **`/INCREMENTAL`** is used, the filename is created by appending *`.ilk`* to the target base filename.
20
+
21
+
## Remarks
22
+
23
+
The **`/ILK`** linker option tells the linker the path and filename to use for the *`.ilk`* incremental database file when you specify [`/INCREMENTAL`](./incremental-link-incrementally.md).
24
+
25
+
### To set this compiler option in the Visual Studio development environment
26
+
27
+
1. Open the project **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
Specifies whether to link incrementally or always perform a full link.
12
+
13
+
## Syntax
14
+
15
+
> **`/INCREMENTAL`**\[**`:NO`**]
14
16
15
17
## Remarks
16
18
17
-
Controls how the linker handles incremental linking.
19
+
The **`/INCREMENTAL`** linker option controls how the linker handles incremental linking.
18
20
19
-
By default, the linker runs in incremental mode. To override a default incremental link, specify /INCREMENTAL:NO.
21
+
By default, the linker runs in incremental mode. To override a default incremental link, specify **`/INCREMENTAL:NO`**.
20
22
21
-
An incrementally linked program is functionally equivalent to a program that is non-incrementally linked. However, because it is prepared for subsequent incremental links, an incrementally linked executable, static library, or dynamic-link library file:
23
+
An incrementally linked program is functionally equivalent to a program that is non-incrementally linked. However, because it's prepared for subsequent incremental links, an incrementally linked executable, static library, or dynamic-link library file:
22
24
23
25
- Is larger than a non-incrementally linked program because of padding of code and data. Padding enables the linker to increase the size of functions and data without recreating the file.
24
26
@@ -27,35 +29,37 @@ An incrementally linked program is functionally equivalent to a program that is
27
29
> [!NOTE]
28
30
> To ensure that your final release build does not contain padding or thunks, link your program non-incrementally.
29
31
30
-
To link incrementally regardless of the default, specify /INCREMENTAL. When this option is selected, the linker issues a warning if it cannot link incrementally, and then links the program non-incrementally. Certain options and situations override /INCREMENTAL.
32
+
To link incrementally regardless of the default, specify **`/INCREMENTAL`**. When this option is selected, the linker issues a warning if it can't link incrementally, and then links the program non-incrementally. Certain options and situations override **`/INCREMENTAL`**.
31
33
32
34
Most programs can be linked incrementally. However, some changes are too great, and some options are incompatible with incremental linking. LINK performs a full link if any of the following options are specified:
33
35
34
-
- Link Incrementally is not selected (/INCREMENTAL:NO)
36
+
- Link Incrementally isn't selected (**`/INCREMENTAL:NO`**)
35
37
36
-
- /OPT:REF is selected
38
+
-**`/OPT:REF`** is selected
37
39
38
-
- /OPT:ICF is selected
40
+
-**`/OPT:ICF`** is selected
39
41
40
-
- /OPT:LBR is selected
42
+
-**`/OPT:LBR`** is selected
41
43
42
-
- /ORDER is selected
44
+
-**`/ORDER`** is selected
43
45
44
-
/INCREMENTAL is implied when [/DEBUG](debug-generate-debug-info.md) is specified.
46
+
**`/INCREMENTAL`** is implied when [`/DEBUG`](debug-generate-debug-info.md) is specified.
45
47
46
48
Additionally, LINK performs a full link if any of the following situations occur:
47
49
48
-
- The incremental status (.ilk) file is missing. (LINK creates a new .ilk file in preparation for subsequent incremental linking.)
50
+
- The incremental status (*`.ilk`*) file is missing. (LINK creates a new *`.ilk`* file in preparation for subsequent incremental linking.)
49
51
50
-
- There is no write permission for the .ilk file. (LINK ignores the .ilk file and links non-incrementally.)
52
+
- There's no write permission for the *`.ilk`* file. (LINK ignores the *`.ilk`* file and links non-incrementally.)
51
53
52
-
- The .exe or .dll output file is missing.
54
+
- The *`.exe`* or *`.dll`* output file is missing.
53
55
54
-
- The timestamp of the .ilk, .exe, or .dll is changed.
56
+
- The timestamp of the *`.ilk`*, *`.exe`*, or *`.dll`* is changed.
55
57
56
58
- A LINK option is changed. Most LINK options, when changed between builds, cause a full link.
57
59
58
-
- An object (.obj) file is added or omitted.
60
+
- An object (*`.obj`*) file is added or omitted.
61
+
62
+
An incremental link creates or updates an incremental link database *`.ilk`* file. You can specify the name and location of this file by using the [`/ILK` (Name incremental database file)](./ilk-name-incremental-database-file.md) linker option. For more information about the *`.ilk`* file, see [`.ilk` files as linker input](./dot-ilk-files-as-linker-input.md).
59
63
60
64
### To set this linker option in the Visual Studio development environment
61
65
@@ -71,5 +75,6 @@ Additionally, LINK performs a full link if any of the following situations occur
71
75
72
76
## See also
73
77
74
-
[MSVC linker reference](linking.md)<br/>
75
-
[MSVC Linker Options](linker-options.md)
78
+
[MSVC linker reference](linking.md)\
79
+
[MSVC linker options](linker-options.md)\
80
+
[`.ilk` files as linker input](./dot-ilk-files-as-linker-input.md)
You provide the linker with files that contain objects, import and standard libraries, resources, module definitions, and command input. LINK does not use file extensions to make assumptions about the contents of a file. Instead, LINK examines each input file to determine what kind of file it is.
10
+
You provide the linker with files that contain objects, import and standard libraries, resources, module definitions, and command input. LINK doesn't use file extensions to make assumptions about the contents of a file. Instead, LINK examines each input file to determine what kind of file it is.
11
11
12
-
Object files on the command line are processed in the order they appear on the command line. Libraries are searched in command line order as well, with the following caveat: Symbols that are unresolved when bringing in an object file from a library are searched for in that library first, and then the following libraries from the command line and [/DEFAULTLIB (Specify Default Library)](defaultlib-specify-default-library.md) directives, and then to any libraries at the beginning of the command line.
12
+
Object files on the command line are processed in the order they appear on the command line. Libraries are searched in command line order as well, with the following caveat: Symbols that are unresolved when bringing in an object file from a library are searched for in that library first, and then the following libraries from the command line and [`/DEFAULTLIB` (Specify default library)](defaultlib-specify-default-library.md) directives, and then to any libraries at the beginning of the command line.
13
13
14
14
> [!NOTE]
15
-
> LINK no longer accepts a semicolon (or any other character) as the start of a comment in response files and order files. Semicolons are recognized only as the start of comments in module-definition files (.def).
15
+
> LINK no longer accepts a semicolon (or any other character) as the start of a comment in response files and order files. Semicolons are recognized only as the start of comments in module-definition files (`.def`).
// When there's no constructor, an empty brace initializer does
46
+
// value initialization = {0,0,0,0,0}
47
+
TempData td_emptyInit{};
47
48
48
49
// Uninitialized = if used, emits warning C4700 uninitialized local variable
49
50
TempData td_noInit;
@@ -55,7 +56,7 @@ int main()
55
56
}
56
57
```
57
58
58
-
When a `class` or `struct` has no constructor, you provide the list elements in the order that the members are declared in the `class`. If the `class` has a constructor, provide the elements in the order of the parameters. If a type has a default constructor, either implicitly or explicitly declared, you can use default brace initialization (with empty braces). For example, the following `class` may be initialized by using both default and non-default brace initialization:
59
+
When a `class` or `struct` has no constructor, you provide the list elements in the order that the members are declared in the `class`. If the `class` has a constructor, provide the elements in the order of the parameters. If a type has a default constructor, either implicitly or explicitly declared, you can use brace initialization with empty braces to invoke it. For example, the following `class` may be initialized by using both empty and non-empty brace initialization:
59
60
60
61
```cpp
61
62
#include <string>
@@ -106,7 +107,7 @@ int main()
106
107
}
107
108
```
108
109
109
-
If the default constructor is explicitly declared but marked as deleted, default brace initialization can't be used:
110
+
If the default constructor is explicitly declared but marked as deleted, empty brace initialization can't be used:
0 commit comments