Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1079936
  • 博文数量: 165
  • 博客积分: 3900
  • 博客等级: 中校
  • 技术积分: 1887
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-06 15:15
文章分类

全部博文(165)

文章存档

2020年(3)

2019年(8)

2017年(2)

2016年(8)

2015年(14)

2013年(15)

2012年(32)

2011年(11)

2010年(14)

2009年(7)

2008年(20)

2007年(31)

分类: C/C++

2012-07-18 00:18:56

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了
阅读(1364) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~