Edit

Share via


Linker tools errors and warnings (LNKxxxx)

The linker tools LINK, LIB, DUMPBIN, and EDITBIN share a common executable that generates these errors and warnings. The tools generate warnings of the form LNKxxxx, where xxxx is a four-digit number.

Important

The Visual Studio compilers and build tools can report many kinds of errors and warnings. After an error or warning is found, the build tools may make assumptions about code intent and attempt to continue, so that more issues can be reported at the same time. If the tools make the wrong assumption, later errors or warnings may not apply to your project. When you correct issues in your project, always start with the first error or warning that's reported, and rebuild often. One fix may resolve multiple subsequent errors.

To get help on a particular diagnostic message in Visual Studio, select it in the Output window and press the F1 key. Visual Studio opens the documentation page for that error, if one exists. You can also use the search tool at the top of the page to find articles about specific errors or warnings. Or, browse the list of errors and warnings by tool and type in the table of contents on this page.

Note

Not every Visual Studio error or warning is documented. In many cases, the diagnostic message provides all of the information that's available. If you landed on this page and think the error or warning message needs additional explanation, let us know by using the feedback buttons on this page. If you think the error or warning is wrong, or you've found another problem with the toolset, report a product issue on the Developer Community site. You can also send feedback and enter bugs within the IDE. In Visual Studio, go to the menu bar and choose Help > Send Feedback > Report a Problem, or submit a suggestion by using Help > Send Feedback > Suggest a Feature. Some compiler error topics were created that are not emitted by the compiler and now redirect to this page instead.

You may find additional assistance for errors and warnings in Microsoft Q&A C++ forums. Or, search for the error or warning number on the Visual Studio C++ Developer Community site. You can also search Stack Overflow to find solutions.

For links to additional help and community resources, see Visual C++ Help and Community.

Linker tools errors

Error Message
Linker Tools Error LNK1000 unknown error; consult documentation for technical support options
Linker Tools Error LNK1103 debugging information corrupt; recompile module
Linker Tools Error LNK1104 cannot open file 'filename'
Linker Tools Error LNK1106 invalid file or disk full: cannot seek to location
Linker Tools Error LNK1107 invalid or corrupt file: cannot read at location address
Linker Tools Error LNK1112 module machine type 'type1' conflicts with target machine type 'type2'
Linker Tools Error LNK1113 invalid machine type type
Linker Tools Error LNK1120 number unresolved externals
Linker Tools Error LNK1123 failure during conversion to COFF: file invalid or corrupt
Linker Tools Error LNK1127 library is corrupt
Linker Tools Error LNK1136 invalid or corrupt file
Linker Tools Error LNK1140 too many modules for program database; link with /PDB:NONE
Linker Tools Error LNK1141 failure during build of exports file
Linker Tools Error LNK1143 invalid or corrupt file: no symbol for COMDAT section number
Linker Tools Error LNK1152 cannot resolve one or more undecorated symbols
Linker Tools Error LNK1158 cannot run 'filename'
Linker Tools Error LNK1164 section section alignment (number) greater than /ALIGN value
Linker Tools Error LNK1166 cannot adjust code at offset=offset, va=value
Linker Tools Error LNK1168 cannot open filename for writing
Linker Tools Error LNK1169 one or more multiply defined symbols found
Linker Tools Error LNK1170 line in command file contains maximum-length or more characters
Linker Tools Error LNK1179 invalid or corrupt file: duplicate COMDAT 'filename'
Linker Tools Error LNK1181 cannot open input file 'filename'
Linker Tools Error LNK1188 BADFIXUPSECTION:: invalid fixup target 'symbol'; possible zero length section
Linker Tools Error LNK1189 LIBTOOMANYMEMBERS:: library limit of number objects exceeded
Linker Tools Error LNK1196 invalid or corrupt import object: unknown version
Linker Tools Error LNK1200 error reading program database 'filename'
Linker Tools Error LNK1201 error writing to program database 'filename'; check for insufficient disk space, invalid path, or insufficient privilege
Linker Tools Error LNK1211 precompiled type information not found; 'filename' not linked or overwritten
Linker Tools Error LNK1215 metadata operation failed (HRESULT) : error
Linker Tools Error LNK1218 warning treated as error; no output file generated
Linker Tools Error LNK1221 a subsystem can't be inferred and must be defined
Linker Tools Error LNK1223 invalid or corrupt file: file contains invalid .pdata contributions
Linker Tools Error LNK1224 invalid image base address
Linker Tools Error LNK1237 during code generation, compiler introduced reference to symbol 'symbol' defined in module 'module' compiled with /GL
Linker Tools Error LNK1240 failed to compile IDL content
Linker Tools Error LNK1241 resource file 'resource file' already specified
Linker Tools Error LNK1245 invalid subsystem 'subsystem' specified; /SUBSYSTEM must be WINDOWS, WINDOWSCE, or CONSOLE
Linker Tools Error LNK1248 image size ('output_size') exceeds maximum allowable size (maximum_size)
Linker Tools Error LNK1256 ALINK operation failed : reason
Linker Tools Error LNK1264 /LTCG:PGINSTRUMENT specified but no code generation required; instrumentation failed
Linker Tools Error LNK1277 object record not found in pgd (filename)
Linker Tools Error LNK1282 unable to /REBASE file; it has been signed
Linker Tools Error LNK1287 invalid managed entry point function
Linker Tools Error LNK1296 unable to load filename
Linker Tools Error LNK1301 LTCG clr modules found, incompatible with /LTCG:parameter
Linker Tools Error LNK1302 only support linking safe .netmodules; unable to link file .netmodule
Linker Tools Error LNK1306 DLL entry point function cannot be managed; compile to native
Linker Tools Error LNK1309 type1 module detected; invalid with switch /CLRIMAGETYPE:type2
Linker Tools Error LNK1312 invalid or corrupt file: unable to import assembly
Linker Tools Error LNK1313 ijw/native module detected; cannot link with pure modules
Linker Tools Error LNK1314 corrupt or invalid COFF symbol table (undefined static or label symbol)
Linker Tools Error LNK1318 Unexpected PDB error; cause 'details'
Linker Tools Error LNK1332 detected <count> Windows Runtime types imported in one module and defined in another module
Linker Tools Error LNK1352 'section_name_1' and 'section_name_2' cannot be merged into different sections
Linker Tools Error LNK1561 entry point must be defined
Linker Tools Error LNK2001 unresolved external symbol "symbol"
Linker Tools Error LNK2004 gp relative fixup overflow to 'target'; short section 'section' is too large or out of range.
Linker Tools Error LNK2005 symbol already defined in object
Linker Tools Error LNK2008 Fixup target is not aligned 'symbol_name'
Linker Tools Error LNK2011 precompiled object not linked in; image may not run
Linker Tools Error LNK2013 fixup type fixup overflow. Target 'symbol name' is out of range
Linker Tools Error LNK2017 'symbol' relocation to 'segment' invalid without /LARGEADDRESSAWARE:NO
Linker Tools Error LNK2019 unresolved external symbol 'symbol' referenced in function 'function'
Linker Tools Error LNK2020 unresolved token 'token'
Linker Tools Error LNK2022 metadata operation failed (HRESULT) : error_message
Linker Tools Error LNK2023 bad dll or entry point <dll or entry point>
Linker Tools Error LNK2026 module unsafe for SAFESEH image
Linker Tools Error LNK2027 unresolved module reference 'module'
Linker Tools Error LNK2028 "exported_function" (decorated_name) referenced in function "function_containing_function_call" (decorated_name)
Linker Tools Error LNK2031 unable to generate p/invoke for "function_declaration" decorated_name; calling convention missing in metadata
Linker Tools Error LNK2033 unresolved typeref token (token) for 'type'
Linker Tools Error LNK2038 mismatch detected for 'name': value 'value_1' doesn't match value 'value_2' in filename.obj
Linker Tools Error LNK2039 importing ref class <type> that is defined in another.obj; it should be either imported or defined, but not both

Linker tools warnings

Warning Message
Linker Tools Warning LNK4001 no object files specified; libraries used
Linker Tools Warning LNK4002 symbol defined in object
Linker Tools Warning LNK4006 symbol already defined in object; second definition ignored
Linker Tools Warning LNK4010 invalid subsystem version number number; default subsystem version assumed
Linker Tools Warning LNK4014 cannot find member object "objectname"
Linker Tools Warning LNK4020 a type record in 'filename' is corrupted; some symbols and types may not be accessible from the debugger
Linker Tools Warning LNK4022 cannot find unique match for symbol 'symbol'
Linker Tools Warning LNK4039 section 'name' specified with /SECTION option does not exist
Linker Tools Warning LNK4044 unrecognized option 'option'; ignored
Linker Tools Warning LNK4049 symbol 'symbol' defined in 'filename.obj' is imported
Linker Tools Warning LNK4065 'function' cannot be ordered; ignored
Linker Tools Warning LNK4070 /OUT:filename directive in .EXP differs from output filename 'filename'; ignoring directive
Linker Tools Warning LNK4071 cannot be incrementally linked on subsequent links
Linker Tools Warning LNK4073 cannot create map for .ilk file; linking nonincrementally
Linker Tools Warning LNK4075 ignoring "option1" due to "option2" specification
Linker Tools Warning LNK4076 invalid incremental status file 'filename'; linking nonincrementally
Linker Tools Warning LNK4078 multiple 'section name' sections found with different attributes
Linker Tools Warning LNK4086 entrypoint 'function' is not __stdcall with 'number' bytes of arguments; image may not run
Linker Tools Warning LNK4092 shared writable section 'section' contains relocations; image may not run correctly
Linker Tools Warning LNK4096 /BASE value "number" is invalid for Windows 95 and Windows 98; image may not run
Linker Tools Warning LNK4098 defaultlib 'library' conflicts with use of other libs; use /NODEFAULTLIB:library
Linker Tools Warning LNK4099 PDB 'filename' was not found with 'object/library' or at 'path'; linking object as if no debug info
Linker Tools Warning LNK4102 export of deleting destructor 'name'; image may not run correctly
Linker Tools Warning LNK4104 export of symbol 'symbol' should be PRIVATE
Linker Tools Warning LNK4105 no argument specified with option 'option'; ignoring option
Linker Tools Warning LNK4194 /DELAYLOAD:dll name ignored
Linker Tools Warning LNK4197 export 'exportname' specified multiple times; using first specification
Linker Tools Warning LNK4199 /DELAYLOAD:dllname ignored; no imports found from dllname
Linker Tools Warning LNK4200 corrupt line number information in object file; ignored
Linker Tools Warning LNK4204 'filename' is missing debugging information for referencing module; linking object as if no debug info
Linker Tools Warning LNK4205 'filename' is missing current debugging information for referencing module; linking object as if no debug info
Linker Tools Warning LNK4206 precompiled type information not found; 'filename' not linked or overwritten; linking object as if no debug info
Linker Tools Warning LNK4210 section section exists; there may be unhandled static initializers or terminators
Linker Tools Warning LNK4216 Exported entry point entry
Linker Tools Warning LNK4217 symbol 'symbol' defined in 'filename_1.obj' is imported by 'filename_2.obj' in function 'function'
Linker Tools Warning LNK4219 fixup name fixup overflow. Target 'target symbol name' is out of range, inserting thunk
Linker Tools Warning LNK4220 invalid 'linker option' value 'value'; assumed default
Linker Tools Warning LNK4221 This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
Linker Tools Warning LNK4222 exported symbol 'symbol' should not be assigned an ordinal
Linker Tools Warning LNK4224 option is no longer supported; ignored
Linker Tools Warning LNK4227 metadata operation warning (HRESULT) : warning_message
Linker Tools Warning LNK4229 invalid directive /directive found; ignored
Linker Tools Warning LNK4237 /SUBSYSTEM:NATIVE specified when importing from 'dll'; Use /SUBSYSTEM:CONSOLE or /SUBSYSTEM:WINDOWS.
Linker Tools Warning LNK4247 entry point 'decorated_function_name' already has a thread attribute; 'attribute' ignored
Linker Tools Warning LNK4248 unresolved typeref token (token) for 'type'; image may not run
Linker Tools Warning LNK4253 section 'section1' not merged into 'section2'; already merged into 'section3'
Linker Tools Warning LNK4254 section 'section1' (offset) merged into 'section2' (offset) with different attributes
Linker Tools Warning LNK4286 symbol 'symbol' defined in 'filename_1.obj' is imported by 'filename_2.obj'
Linker Tools Warning LNK4306 The auxiliary delayload import address table is not properly aligned with the primary delayload import address table. This may have negative perf impact.
Linker Tools Warning LNK4307 The auxiliary delayload import address table copy is not properly aligned with the auxiliary delayload import address table. This may have negative perf impact.

See also

C/C++ Compiler and build tools errors and warnings