Specifications
Linker Tools Messages Page 15 of 32
When you are porting an application from 16 to 32 bits, LNK2001 can occur. The current 32-
bit module-definition (.DEF) file syntax requires that __cdecl, __stdcall, and __fastcall functions
be listed in the EXPORTS section without underscores (undecorated). This differs from the 16-
bit syntax, where they must be listed with underscores (decorated). For more information, see
the description of the EXPORTS section of module-definition files.
Any export listed in the .DEF file and not found will cause LNK2001. This could be because it
does not exist, is spelled incorrectly, or uses decorated names (.DEF files do not take decorated
names). This error message is followed by fatal error LNK1120.
The following sections give more detailed information on some of the issues named in the above list.
Missing function body or variable
Having just a function prototype will allow the compiler to continue without error, but the
linker will not be able to resolve your call to an address because there is no function code or
variable space reserved. You will not see this error until you create an actual call to the function
that the linker must resolve.
Name decoration
Normally this refers to C++ naming conventions, but it applies to a number of non-C++ cases as
well. C++ by default will use the name of a function, its parameters and its return type when
calculating a name for a function.
Use extern "C" when calling a C function from a C++ program. Extern "C" forces use of the C
naming convention for non-class C++ functions.
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 and /GPSIZE. 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:
The most common cause of this error is accidentally linking with both the single-threaded and
multithreaded libraries. Ensure that the application project file includes only the appropriate
libraries and that any third-party libraries have appropriately created single-threaded or
multithreaded versions.
The given symbol was a packaged function (created by compiling with /Gy) and was included in










