Linker Errors LNK2001 to LNK2014

Linker Tools Error LNK2001
unresolved external symbol "symbol"
Code will generate this error message if it references something (like a function, variable, or label) that the linker cannot find in all the libraries and object files it searches. In general, there are two reasons this error occurs: what the code asks for doesn't exist (the symbol is spelled incorrectly or uses the wrong case, for example), or the code asks for the wrong thing (you are using mixed versions of the libraries; some from one version of the product, others from another version).

Depending on the calling convention used, an at sign (@) and a decimal number may be appended to the symbol name (see ATTRIBUTES Properties and Calling Conventions).

Numerous kinds of coding and build errors can cause LNK2001. Several specific causes are listed below, and some have more detailed explanations.

Coding Problems:

Compiling and Linking Problems:

Export Problems:

The following sections give more detailed information on some of the issues named in the above list.

Linker Tools Error LNK2003
gp relative fixup to symbol not in .sdata "module"
The /Gt value specified when compiling an instance of a type differed from the value specified when compiling the reference to the type. Rebuild the object files with consistent values for /Gt. This error is followed by fatal error LNK1165.

Linker Tools Error LNK2004
gp relative fixup overflow; sdata section ("section") is too large
The .sdata section was too large. Rebuild using smaller values for /Gt. This error is followed by fatal error LNK1165.

Linker Tools Error LNK2005
symbol already defined in object
The given symbol, displayed in its decorated form, was multiply defined. One of the following may be a cause:

Linker Tools Error LNK2006
TOC relative fixup to symbol not in TOC "name"; fixup ignored
LINK found an invalid fixup and ignored it.

Linker Tools Error LNK2007
TOC relative fixup overflow; TOC is too large; fixup ignored
LINK found an invalid fixup and ignored it.

Linker Tools Error LNK2008
Fixup target is not aligned "alignment"
LINK found a fixup target in your object file that was not aligned properly.

Linker Tools Error LNK2009
Fixup target must be absolute "name" w/o -FIXED; fixup ignored
LINK found an invalid fixup and ignored it.

Linker Tools Error LNK2010
Duplicate IMGLUE relocations for "name"
LINK found duplicate relocations for "name" in your object file. The object file is probably corrupt. See Corrupt Object File for more information.

Linker Tools Error LNK2011
precompiled object not linked in; image may not run
If you use precompiled headers, LINK now 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.

Linker Tools Error LNK2012
No NOP following relocationtype relocation to "symbol"
TOCINDIRCALL and TOCCALLREL require a NOP following the instruction that has this type of relocation. This is mainly useful for compiler and assembler developers who use the Microsoft linker.

Linker Tools Error LNK2013
Fixup overflow. Target "symbol" is out of range
This error occurs when the executable is too large or the error may indicate a problem with assembly code. To work around the problem:

You can eliminate the TOC space by moving such data to the module where it is referenced. However, if data is referenced in multiple modules, then the TOC space cannot be eliminated to save space.

Linker Tools Error LNK2014
TLS relative fixup overflow; .tls section ("section") is too large
The section created for thread-local storage (.tls) is too large. TLS data must fit in 32 KB. This data is created using the __declspec(thread) storage class modifier in the declaration and definition of that data. To work around the problem:


Return to Main Linker Error Page