MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _printf already defined in LIBCD.lib(printf.obj)
一般形式:
MSVCRTD.lib(MSVCRTD.dll) : error LNK2005: _XXX already defined in YYY.lib(XXX.obj)
原因:
主程序和lib所使用的运行库不一致
解决方法:
For example, if you received this warning and you want to create an
executable file that uses the non-debug, single-threaded version of the
run-time libraries, you could use the following options with the linker:
/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib
或者这样:For example, if you received this warning and you want to create an
executable file that uses the non-debug, single-threaded version of the
run-time libraries, you could use the following options with the
linker:
/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib
/NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB写程序看到
warning,感觉不爽。 这个警告在 link option 中 加入 对应的 /NODEFAULTLIB:xxx.lib 就ok了
阅读(1484) | 评论(0) | 转发(0) |