Skip to content

Commit 6fbee14

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [LNK2001, LNK2039]
1 parent e736995 commit 6fbee14

15 files changed

+32
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: dc1cf267-c984-486c-abd2-fd07c799f7ef
1010

1111
> unresolved external symbol "*symbol*"
1212
13+
## Remarks
14+
1315
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.
1416

1517
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 07645371-e67b-4a2c-b0e0-dde24c94ef7e
1010

1111
> gp relative fixup overflow to 'target'; short section 'section' is too large or out of range.
1212
13+
## Remarks
14+
1315
The section was too large.
1416

1517
To resolve this error, reduce the size of the short section, either by explicitly putting data in the long sections via #pragma section(".sectionname", read, write, long) and using `__declspec(allocate(".sectionname"))` on data definitions and declarations. For example,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: d9587adc-68be-425c-8a30-15dbc86717a4
1010

1111
> *symbol* already defined in object
1212
13+
## Remarks
14+
1315
The symbol *symbol* was defined more than once.
1416

1517
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: bbcd83c5-c8ae-439e-a033-63643a5bb373
1010

1111
> Fixup target is not aligned 'symbol_name'
1212
13+
## Remarks
14+
1315
LINK found a fixup target in your object file that was not aligned properly.
1416

1517
This error can be caused by custom secton alignment (for example, #pragma [pack](../../preprocessor/pack.md)), [align](../../cpp/align-cpp.md) modifier, or by using assembly language code that modifies secton alignment.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ helpviewer_keywords: ["LNK2011"]
99

1010
> precompiled object not linked in; image may not run
1111
12+
## Remarks
13+
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 21408e2d-3f56-4d1f-a031-00df70785ed4
1010

1111
> fixup type fixup overflow. Target 'symbol name' is out of range
1212
13+
## Remarks
14+
1315
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.
1416

1517
You can resolve this problem by creating multiple images or by using the [/ORDER](../../build/reference/order-put-functions-in-order.md) option so the instruction and target are closer together.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: f7c21733-b0fb-4888-a295-9b453ba6ee77
1010

1111
> 'symbol' relocation to 'segment' invalid without /LARGEADDRESSAWARE:NO
1212
13+
## Remarks
14+
1315
You are trying to build a 64-bit image with 32-bit addresses. To do this, you must:
1416

1517
- Use a fixed load address.

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

Lines changed: 2 additions & 0 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.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ helpviewer_keywords: ["LNK2020"]
99

1010
> unresolved token 'token'
1111
12+
## Remarks
13+
1214
Similar to an undefined external error, except that the reference is via metadata. In metadata, all functions and data must be defined.
1315

1416
To resolve:

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: c99e35a8-739a-4a20-a715-29b8c3744703
1010

1111
> bad dll or entry point \<dll or entry point>
1212
13+
## Remarks
14+
1315
The linker is loading an incorrect version of msobj90.dll. Ensure that link.exe and msobj90.dll in your path have the same version.
1416

1517
A dependency of msobj90.dll may not be present. The dependency list for msobj90.dll is:

0 commit comments

Comments
 (0)