Compilation: Error Messages

Where the messages contain “...”, this means that, for clarity, I've removed sometimes very many lines of error messages, usually indicating that the identifiers (e.g. function names) are “already defined” and “mismatch detected for ‘RuntimeLibrary’”.

Apart from the numerous aforementioned error messages, the first and last few lines may be sufficient to indicate the problem. The first few lines beging with the name of the library, followed by its linking format (e.g. DynamicRelease), and then the name of the main object file along with its linking format. This should make it pretty obvious how to solve the error.

1. Missing library

For a missing library, the error message is identical for all static, dynamic, debug, and release options.

LNK1120: unresolved externals

2. Main = Dynamic

2.1 Main = Dynamic release

2.1.1 Lib = Dynamic debug
CDlib_dd.obj : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in CDmain_dr.obj
CDlib_dd.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in CDmain_dr.obj
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
CDmain_dr.exe : fatal error LNK1319: 2 mismatches detected
2.1.2 Lib = Static release
CDlib_sr.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in CDmain_dr.obj
...
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
CDmain_dr.exe : fatal error LNK1169: one or more multiply defined symbols found
2.1.3 Lib = Static debug
CDlib_sd.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MD_DynamicRelease' in CDmain_dr.obj
...
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
CDmain_d.exe : fatal error LNK1169: one or more multiply defined symbols found

2.2 Main = Dynamic debug

2.2.1 Lib = Dynamic release
CDlib_dr.obj : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in CDmain_dd.obj
CDlib_dr.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in CDmain_dd.obj
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
CDmain_dd.exe : fatal error LNK1319: 2 mismatches detected
2.2.2 Lib = Static release
CDlib_sr.obj : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in CDmain_dd.obj
CDlib_sr.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in CDmain_dd.obj
...
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
CDmain_dd.exe : fatal error LNK1169: one or more multiply defined symbols found
2.2.3 Lib = Static debug
CDlib_sd.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in CDmain_dd.obj
...
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
CDmain_dd.exe : fatal error LNK1169: one or more multiply defined symbols found

3.1 Main = Static release

3.1.1 Lib = Static debug
CDlib_sd.obj : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in CDmain_sr.obj
CDlib_sd.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in CDmain_sr.obj
...
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
CDmain_sr.exe : fatal error LNK1169: one or more multiply defined symbols found
3.1.2 Lib = Dynamic release
CDlib_dr.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in CDmain_sr.obj
...
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
CDmain_sr.exe : fatal error LNK1169: one or more multiply defined symbols found
3.1.3 Lib = Dynamic debug
CDlib_dd.obj : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in CDmain_sr.obj
CDlib_dd.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MT_StaticRelease' in CDmain_sr.obj
...
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
CDmain_sr.exe : fatal error LNK1169: one or more multiply defined symbols found

3.2 Main = Static debug

3.2.1 Lib = Static release
CDlib_sr.obj : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in CDmain_sd.obj
CDlib_sr.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MTd_StaticDebug' in CDmain_sd.obj
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
CDmain_sd.exe : fatal error LNK1319: 2 mismatches detected
3.2.2 Lib = Dynamic release
CDlib_dr.obj : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in CDmain_sd.obj
CDlib_dr.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MTd_StaticDebug' in CDmain_sd.obj
...
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
CDmain_sd.exe : fatal error LNK1169: one or more multiply defined symbols found
3.2.3 Lib = Dynamic debug
CDlib_dd.obj : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in CDmain_sd.obj
...
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
CDmain_sd.exe : fatal error LNK1169: one or more multiply defined symbols found


Home About Me
Copyright © Neil Carter

Last updated: 2016-04-06