The following error occurs: libcmtd. Lib (crt0dat. OBJ): Error lnk2005: _ exit, which is already defined in msvcrtd. Lib (msvcr71d. dll ).
Cause:
Run-Time Library• Run-time Library is the standard library provided by the compiler and provides some basic library functions and system calls.
The run-time library we generally use is C run-time libraries. Standard C ++ libraries is also available.
C run-time libraries implements the ansi c standard library. The CRT directory of the VC installation directory contains most of the source code of the C run-time library. C run-time libraries has a static library version, a dynamic link library version, a single-thread version, a multi-thread version, and a debug and non-debug version. • Dynamic Link Library version:
/MD multithreaded DLL import database msvcrt. Lib
/MDD debug multithreaded DLL use the import library msvcrtd. Lib • static library version:
/Ml single-threaded uses static library libc. Lib
/MLD debug single-threaded use static library libcd. Lib
/MT multithreaded uses the static library libcmt. Lib
/MTD debug multithreaded uses the static library libcmtd. Lib
To use this Runtime Library |
Ignore these libraries |
Single thread (libc. Lib) |
Libcmt. Lib, msvcrt. Lib, libcd. Lib, libcmtd. Lib, and msvcrtd. Lib |
Multithreading (libcmt. Lib) |
Libc. Lib, msvcrt. Lib, libcd. Lib, libcmtd. Lib, and msvcrtd. Lib |
Multiple Threads Using DLL (msvcrt. Lib) |
Libc. Lib, libcmt. Lib, libcd. Lib, libcmtd. Lib, and msvcrtd. Lib |
Debug a single thread (libcd. Lib) |
Libc. Lib, libcmt. Lib, msvcrt. Lib, libcmtd. Lib, and msvcrtd. Lib |
Debug multiple threads (libcmtd. Lib) |
Libc. Lib, libcmt. Lib, msvcrt. Lib, libcd. Lib, and msvcrtd. Lib |
Multi-thread Debugging Using DLL (msvcrtd. Lib) |
Libc. Lib, libcmt. Lib, msvcrt. Lib, libcd. Lib, libcmtd. Lib |
Solution: attribute, linker, input, ignore specified library libc. lib, libcmt. lib, msvcrt. lib, libcd. lib, libcmtd. lib (this is something I need to ignore. You can select it based on the actual situation of your project .) Update (20060205 ):
5.When the link fails to open mfc4xx. Lib, this is because vc7 has upgraded the mfc dll.
Solution:
Attribute, linker, input, and add mfc71d. lib to additional dependencies. /Nodefalib lib (ignore Library) indicates the library ignored by the linker when the linker resolves external references.