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
Copy file name to clipboardExpand all lines: docs/error-messages/tool-errors/linker-tools-warning-lnk4049.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -17,17 +17,17 @@ Warning LNK4049 is a more general version of [Linker Tools Warning LNK4217](link
17
17
18
18
The common cases where LNK4049 is generated instead of LNK4217 are:
19
19
20
-
-Performing incremental linking by using the [/INCREMENTAL](../../build/reference/incremental-link-incrementally.md) option.
20
+
-When using the [/INCREMENTAL](../../build/reference/incremental-link-incrementally.md) option.
21
21
22
-
-Performing whole-program optimization by using the [/LTCG](../../build/reference/ltcg-link-time-code-generation.md) option.
22
+
-When using the [/LTCG](../../build/reference/ltcg-link-time-code-generation.md) option.
23
23
24
-
To resolve LNK4049, try one of the following:
24
+
To resolve LNK4049, try one of the following procedures:
25
25
26
-
- Remove the `__declspec(dllimport)`name declaration from the forward declaration of the symbol which triggered LNK4049. You can search for symbols within a binary image by using the **DUMPBIN** utility. The **DUMPBIN /SYMBOLS** switch displays the COFF symbol table of the image. For more information on the **DUMPBIN** utility, see [DUMPBIN Reference](../../build/reference/dumpbin-reference.md).
26
+
- Remove the `__declspec(dllimport)`modifier from the forward declaration of the symbol that triggered LNK4049. You can search for symbols within a binary image by using the **DUMPBIN** utility. The **DUMPBIN /SYMBOLS** switch displays the COFF symbol table of the image. For more information on the **DUMPBIN** utility, see [DUMPBIN Reference](../../build/reference/dumpbin-reference.md).
27
27
28
-
- Temporarily disable incremental linking and whole-program optimization. Recompiling the application will generate Warning LNK4217, which will include the name of the function from which the imported symbol was referenced. Remove the `__declspec(dllimport)` declaration from the imported symbol and re-enable incremental linking or whole-program optimization as required.
28
+
- Temporarily disable incremental linking and whole-program optimization. When recompiled, the application generates Warning LNK4217, which includes the name of the function which references the imported symbol. Remove the `__declspec(dllimport)` declaration from the imported symbol and re-enable incremental linking or whole-program optimization as required.
29
29
30
-
Although the final generated code will behave correctly, the code generated to call the imported function is less efficient than calling the function directly. This warning doesn't appear when you compile by using the option [/clr](../../build/reference/clr-common-language-runtime-compilation.md).
30
+
Although the final generated code behaves correctly, the code generated to call the imported function is less efficient than calling the function directly. This warning doesn't appear when you compile by using the [/clr](../../build/reference/clr-common-language-runtime-compilation.md) option.
31
31
32
32
For more information on import and export data declarations, see [dllexport, dllimport](../../cpp/dllexport-dllimport.md).
33
33
@@ -45,7 +45,7 @@ __declspec(dllexport) int func()
45
45
}
46
46
```
47
47
48
-
The second module generates an object file containing a forward declaration to the function exported in the first module, along with a call to this function inside the `main` function. Linking this module with the first module will generate LNK4049. Removing the `__declspec(dllimport)` declaration will resolve the warning.
48
+
The second module generates an object file containing a forward declaration to the function exported in the first module, along with a call to this function inside the `main` function. Linking this module with the first module will generate LNK4049. Remove the `__declspec(dllimport)` modifier from the declaration to resolve the warning.
`symbol` is the symbol name that's defined within the image. `function` is the function that's importing the symbol.
15
15
16
-
This warning will not appear when you compile by using the option [/clr](../../build/reference/clr-common-language-runtime-compilation.md).
16
+
This warning doesn't appear when you compile by using the [/clr](../../build/reference/clr-common-language-runtime-compilation.md) option.
17
17
18
18
LNK4217 can also occur if you attempt to link two modules together, when instead you should compile the second module with the import library of the first module.
Copy file name to clipboardExpand all lines: docs/error-messages/tool-errors/linker-tools-warning-lnk4286.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,9 @@ This warning is generated by the linker when you declare a symbol by using the `
16
16
17
17
Warning LNK4286 is a more general version of [Linker Tools Warning LNK4217](linker-tools-warning-lnk4217.md). The linker generates Warning LNK4286 when it can tell which object file referenced the symbol, but not which function.
18
18
19
-
To resolve LNK4286, remove the `__declspec(dllimport)` name declaration from the forward declaration of the symbol which triggered LNK4286.
19
+
To resolve LNK4286, remove the `__declspec(dllimport)` name declaration from the forward declaration of the symbol that triggered LNK4286.
20
20
21
-
Although the final generated code behaves correctly, the code generated to call an imported function is less efficient than calling the function directly. This warning doesn't appear when you compile by using the option [/clr](../../build/reference/clr-common-language-runtime-compilation.md).
21
+
Although the final generated code behaves correctly, the code generated to call an imported function is less efficient than calling the function directly. This warning doesn't appear when you compile by using the [/clr](../../build/reference/clr-common-language-runtime-compilation.md) option.
22
22
23
23
For more information on import and export data declarations, see [dllexport, dllimport](../../cpp/dllexport-dllimport.md).
0 commit comments