Skip to content

Commit 3d99276

Browse files
authored
Merge pull request #5795 from Rageking8/structure-error-references-in-range-lnk2001-lnk2039
Structure error references in range [LNK2001, LNK2039]
2 parents 9fc19ad + 4c42cd4 commit 3d99276

17 files changed

+81
-61
lines changed

docs/error-messages/tool-errors/linker-tools-error-lnk2001.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2-
description: "Learn more about: Linker Tools Error LNK2001"
32
title: "Linker Tools Error LNK2001"
3+
description: "Learn more about: Linker Tools Error LNK2001"
44
ms.date: 10/22/2021
55
f1_keywords: ["LNK2001"]
66
helpviewer_keywords: ["LNK2001"]
7-
ms.assetid: dc1cf267-c984-486c-abd2-fd07c799f7ef
87
---
98
# Linker Tools Error LNK2001
109

1110
> unresolved external symbol "*symbol*"
1211
12+
## Remarks
13+
1314
The compiled code makes a reference or call to *symbol*. The symbol isn't defined in any libraries or object files searched by the linker.
1415

1516
This error message is followed by fatal error [LNK1120](../../error-messages/tool-errors/linker-tools-error-lnk1120.md). To fix error LNK1120, first fix all LNK2001 and LNK2019 errors.

docs/error-messages/tool-errors/linker-tools-error-lnk2004.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Linker Tools Error LNK2004"
32
title: "Linker Tools Error LNK2004"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Linker Tools Error LNK2004"
4+
ms.date: 11/04/2016
55
f1_keywords: ["LNK2004"]
66
helpviewer_keywords: ["LNK2004"]
7-
ms.assetid: 07645371-e67b-4a2c-b0e0-dde24c94ef7e
87
---
98
# Linker Tools Error LNK2004
109

11-
gp relative fixup overflow to 'target'; short section 'section' is too large or out of range.
10+
> gp relative fixup overflow to 'target'; short section 'section' is too large or out of range.
11+
12+
## Remarks
1213

1314
The section was too large.
1415

docs/error-messages/tool-errors/linker-tools-error-lnk2005.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2-
description: "Learn more about: Linker Tools Error LNK2005"
32
title: "Linker Tools Error LNK2005"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Linker Tools Error LNK2005"
4+
ms.date: 11/04/2016
55
f1_keywords: ["LNK2005"]
66
helpviewer_keywords: ["LNK2005"]
7-
ms.assetid: d9587adc-68be-425c-8a30-15dbc86717a4
87
---
98
# Linker Tools Error LNK2005
109

1110
> *symbol* already defined in object
1211
12+
## Remarks
13+
1314
The symbol *symbol* was defined more than once.
1415

1516
This error is followed by fatal error [LNK1169](../../error-messages/tool-errors/linker-tools-error-lnk1169.md).

docs/error-messages/tool-errors/linker-tools-error-lnk2008.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Linker Tools Error LNK2008"
32
title: "Linker Tools Error LNK2008"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Linker Tools Error LNK2008"
4+
ms.date: 11/04/2016
55
f1_keywords: ["LNK2008"]
66
helpviewer_keywords: ["LNK2008"]
7-
ms.assetid: bbcd83c5-c8ae-439e-a033-63643a5bb373
87
---
98
# Linker Tools Error LNK2008
109

11-
Fixup target is not aligned 'symbol_name'
10+
> Fixup target is not aligned 'symbol_name'
11+
12+
## Remarks
1213

1314
LINK found a fixup target in your object file that was not aligned properly.
1415

docs/error-messages/tool-errors/linker-tools-error-lnk2011.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ helpviewer_keywords: ["LNK2011"]
77
---
88
# Linker Tools Error LNK2011
99

10-
precompiled object not linked in; image may not run
10+
> precompiled object not linked in; image may not run
11+
12+
## Remarks
1113

1214
If you use precompiled headers, LINK requires that all of the object files created with precompiled headers must be linked in. If you have a source file that you use to generate a precompiled header for use with other source files, you now must include the object file created along with the precompiled header.
1315

16+
## Example
17+
1418
For example, if you compile a file called STUB.cpp to create a precompiled header for use with other source files, you must link with STUB.obj or you will get this error. In the following command lines, line one is used to create a precompiled header, COMMON.pch, which is used with PROG1.cpp and PROG2.cpp in lines two and three. The file STUB.cpp contains only `#include` lines (the same `#include` lines as in PROG1.cpp and PROG2.cpp) and is used only to generate precompiled headers. In the last line, STUB.obj must be linked in to avoid LNK2011.
1519

1620
```cmd

docs/error-messages/tool-errors/linker-tools-error-lnk2013.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Linker Tools Error LNK2013"
32
title: "Linker Tools Error LNK2013"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Linker Tools Error LNK2013"
4+
ms.date: 11/04/2016
55
f1_keywords: ["LNK2013"]
66
helpviewer_keywords: ["LNK2013"]
7-
ms.assetid: 21408e2d-3f56-4d1f-a031-00df70785ed4
87
---
98
# Linker Tools Error LNK2013
109

11-
fixup type fixup overflow. Target 'symbol name' is out of range
10+
> fixup type fixup overflow. Target 'symbol name' is out of range
11+
12+
## Remarks
1213

1314
The linker cannot fit the necessary address or offset into the given instruction because the target symbol is too far away from the instruction's location.
1415

docs/error-messages/tool-errors/linker-tools-error-lnk2017.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Linker Tools Error LNK2017"
32
title: "Linker Tools Error LNK2017"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Linker Tools Error LNK2017"
4+
ms.date: 11/04/2016
55
f1_keywords: ["LNK2017"]
66
helpviewer_keywords: ["LNK2017"]
7-
ms.assetid: f7c21733-b0fb-4888-a295-9b453ba6ee77
87
---
98
# Linker Tools Error LNK2017
109

11-
'symbol' relocation to 'segment' invalid without /LARGEADDRESSAWARE:NO
10+
> 'symbol' relocation to 'segment' invalid without /LARGEADDRESSAWARE:NO
11+
12+
## Remarks
1213

1314
You are trying to build a 64-bit image with 32-bit addresses. To do this, you must:
1415

docs/error-messages/tool-errors/linker-tools-error-lnk2019.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ no-loc: [main, WinMain, wmain, wWinMain, __cdecl, __stdcall, __fastcall, __vecto
1010

1111
> unresolved external symbol '*symbol*' referenced in function '*function*'
1212
13+
## Remarks
14+
1315
The compiled code for *function* makes a reference or call to *symbol*, but the linker can't find the symbol definition in any of the libraries or object files.
1416

1517
This error message is followed by fatal error [LNK1120](../../error-messages/tool-errors/linker-tools-error-lnk1120.md). To fix error LNK1120, you must fix all LNK2001 and LNK2019 errors first.
@@ -143,7 +145,7 @@ Unless `i` and `g` are defined in one of the files included in the build, the li
143145

144146
### A static data member is declared but not defined
145147

146-
LNK2019 can also occur when a static data member is declared but not defined. The following sample generates LNK2019, and shows how to fix it.
148+
LNK2019 can also occur when a static data member is declared but not defined. The following example generates LNK2019, and shows how to fix it.
147149

148150
```cpp
149151
// LNK2019b.cpp
@@ -164,7 +166,7 @@ int main() {
164166
165167
### Declaration parameters don't match the definition
166168
167-
Code that invokes function templates must have matching function template declarations. Declarations must include the same template parameters as the definition. The following sample generates LNK2019 on a user-defined operator, and shows how to fix it.
169+
Code that invokes function templates must have matching function template declarations. Declarations must include the same template parameters as the definition. The following example generates LNK2019 on a user-defined operator, and shows how to fix it.
168170
169171
```cpp
170172
// LNK2019e.cpp
@@ -194,7 +196,7 @@ int main() {
194196

195197
### Inconsistent wchar_t type definitions
196198

197-
This sample creates a DLL that has an export that uses `WCHAR`, which resolves to **`wchar_t`**.
199+
This example creates a DLL that has an export that uses `WCHAR`, which resolves to **`wchar_t`**.
198200

199201
```cpp
200202
// LNK2019g.cpp
@@ -204,7 +206,7 @@ This sample creates a DLL that has an export that uses `WCHAR`, which resolves t
204206
__declspec(dllexport) void func(WCHAR*) {}
205207
```
206208
207-
The next sample uses the DLL in the previous sample, and generates LNK2019 because the types `unsigned short*` and `WCHAR*` aren't the same.
209+
The next example uses the DLL in the previous example, and generates LNK2019 because the types `unsigned short*` and `WCHAR*` aren't the same.
208210
209211
```cpp
210212
// LNK2019h.cpp

docs/error-messages/tool-errors/linker-tools-error-lnk2020.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ helpviewer_keywords: ["LNK2020"]
77
---
88
# Linker Tools Error LNK2020
99

10-
unresolved token 'token'
10+
> unresolved token 'token'
11+
12+
## Remarks
1113

1214
Similar to an undefined external error, except that the reference is via metadata. In metadata, all functions and data must be defined.
1315

@@ -19,7 +21,7 @@ To resolve:
1921

2022
## Examples
2123

22-
The following sample generates LNK2020.
24+
The following example generates LNK2020.
2325

2426
```cpp
2527
// LNK2020.cpp
@@ -38,7 +40,7 @@ ref struct B {
3840
3941
LNK2020 will also occur if you create a variable of a managed template type, but do not also instantiate the type.
4042
41-
The following sample generates LNK2020.
43+
The following example generates LNK2020.
4244
4345
```cpp
4446
// LNK2020_b.cpp

docs/error-messages/tool-errors/linker-tools-error-lnk2023.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Linker Tools Error LNK2023"
32
title: "Linker Tools Error LNK2023"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Linker Tools Error LNK2023"
4+
ms.date: 11/04/2016
55
f1_keywords: ["LNK2023"]
66
helpviewer_keywords: ["LNK2023"]
7-
ms.assetid: c99e35a8-739a-4a20-a715-29b8c3744703
87
---
98
# Linker Tools Error LNK2023
109

11-
bad dll or entry point \<dll or entry point>
10+
> bad dll or entry point \<dll or entry point>
11+
12+
## Remarks
1213

1314
The linker is loading an incorrect version of msobj90.dll. Ensure that link.exe and msobj90.dll in your path have the same version.
1415

0 commit comments

Comments
 (0)