In the same project, all source files must be linked to the same C Runtime Library. If a file uses the multithreaded dll version, and other files use the single-threaded or multithreaded version library, that is to say, different libraries will cause this warning.
In a word, there is a conflict between Lib. Some libs to be imported must be deleted.
Version |
Type |
Library Used |
Ignored Library |
R release |
Single thread |
Libc. Lib |
Libcmt. Lib, msvcrt. Lib, libcd. Lib, libcmtd. Lib, msvcrtd. Lib |
Multithreading |
Libcmt. Lib |
Libc. Lib, msvcrt. Lib, libcd. Lib, libcmtd. Lib, msvcrtd. Lib |
Multithreading with DLL |
Msvcrt. Lib |
Libc. Lib, libcmt. Lib, libcd. Lib, libcmtd. Lib, msvcrtd. Lib |
D debug |
Single thread |
Libcd. Lib |
Libc. Lib, libcmt. Lib, msvcrt. Lib, libcmtd. Lib, msvcrtd. Lib |
Multithreading |
Libcmtd. Lib |
Libc. Lib, libcmt. Lib, msvcrt. Lib, libcmtd. Lib, msvcrtd. Lib |
Multithreading with DLL |
Msvcrtd. Lib |
Libc. Lib, libcmt. Lib, msvcrt. Lib, libcd. Lib, libcmtd. Lib |
For example, to compile a single-threaded project of the release version, add the following parameter to the linker command line:/nodefaultlib: libcmt. Lib
/Nodefaultlib: msvcrt. lib/nodefaultlib: libcd. lib/nodefaultlib: libcmtd. lib/nodefaultlib: msvcrtd. Lib
Solution:
Add/MTD or/mt to Cuda compilation options
Project Settings:
If a "libcmt" Conflict error exists, choose "configuration properties"> "linker"> "input"> "ignore a specified library. add lib or add/nodefaultlib: libcmt in "Additional Options" of "configuration properties --> linker --> Command run. lib
The libcmtd library sometimes cannot be ignored. If it is ignored, there will be an external symbol error that cannot be parsed.
In fact, when there is a convenient method link, add the parameter/Force: multiple.