登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

图像处理 视频分析 机器视觉 模式识别

方向比努力更重要

 
 
 

日志

 
 
关于我

河北软件开发项目,电子警察卡口项目,公安天网项目,媒体流处理,数字图像处理。媒体服务器 RTSP、图像处理、车牌识别……DCT变换,H.264压缩

defaultlib “library” conflicts with use of other libs; use /NODEFAULTLIB:library  

2011-02-24 09:18:27|  分类: VS|Window |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

学习英语吧,迫切的需要每天都学习英语,主要是阅读能力,否则没办法深造计算机方向了,主要瓶颈啊:
参考MSDN的官方网站的解释:
http://msdn.microsoft.com/en-us/library/aa267384%28VS.60%29.aspx点击连接
Linker   Tools   Warning   LNK4098
defaultlib   "library "   conflicts   with   use   of   other   libs;   use   /NODEFAULTLIB:library

You   are   trying   to   link   with   incompatible   libraries.


Important       The   run-time   libraries   now   contain   directives   to   prevent   mixing   different   types.   You’ll   receive   this   warning   if   you   try   to   use   different   types   or   debug   and   non-debug   versions   of   the   run-time   library   in   the   same   program.   For   example,   if   you   compiled   one   file   to   use   one   kind   of   run-time   library   and   another   file   to   use   another   kind   (for   example,   single-threaded   versus   multithreaded)   and   tried   to   link   them,   you’ll   get   this   warning.   You   should   compile   all   source   files   to   use   the   same   run-time   library.   See   the   Use   Run-Time   Library   (MD,   /ML,   /MT,   /LD)   compiler   options   for   more   information.  


You   can   use   the   linker’s   /VERBOSE:LIB   switch   to   determine   which   libraries   the   linker   is   searching.   If   you   receive   LNK4098   and   want   to   create   an   executable   file   that   uses,   for   example,   the   single-threaded,   non-debug   run-time   libraries,   use   the   /VERBOSE:LIB   option   to   find   out   which   libraries   the   linker   is   searching.   The   linker   should   print   LIBC.LIB   and   not   LIBCMT.LIB,   MSVCRT.LIB,   LIBCD.LIB,   LIBCMTD.LIB,   or   MSVCRTD.LIB   as   the   libraries   searched.   You   can   tell   the   linker   to   ignore   the   the   incorrect   run-time   libraries   by   typing   the   incorrect   libraries   in   the   Ignore   Libraries   text   box   on   the   Link   tab   of   the   Settings   dialog   box   in   Developer’s   Studio   or   by   using   the   /NODEFAULTLIB:library   option   with   LINK   for   each   library   you   want   to   ignore.   See   the   Ignore   Libraries   (/NODEFAULTLIB)   linker   option   for   more   information.


The   table   below   shows   which   libraries   should   be   ignored   depending   on   which   run-time   library   you   want   to   use.


To   use   this   run-time   library   Ignore   these   libraries  

Single-threaded   (libc.lib)   libcmt.lib,   msvcrt.lib,   libcd.lib,   libcmtd.lib,   msvcrtd.lib  
Multithreaded   (libcmt.lib)   libc.lib,   msvcrt.lib,   libcd.lib,   libcmtd.lib,   msvcrtd.lib  
Multithreaded   using   DLL   (msvcrt.lib)   libc.lib,   libcmt.lib,   libcd.lib,   libcmtd.lib,   msvcrtd.lib  
Debug   Single-threaded   (libcd.lib)   libc.lib,   libcmt.lib,   msvcrt.lib,   libcmtd.lib,   msvcrtd.lib  
Debug   Multithreaded   (libcmtd.lib)   libc.lib,   libcmt.lib,   msvcrt.lib,   libcd.lib,   msvcrtd.lib  
Debug   Multithreaded   using   DLL   (msvcrtd.lib)   libc.lib,   libcmt.lib,   msvcrt.lib,   libcd.lib,   libcmtd.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


 
  Contact   Us       |     E-Mail   this   Page       |     MSDN   Flash   Newsletter 
——————————————————————————————————————————————————

MSDN上的解释为: You are trying to link with incompatible libraries. Important   The run-time libraries now contain directives to prevent mixing different types. You’ll receive this warning if you try to use different types or debug and non-debug versions of the run-time library in the same program. For example, if you compiled one file to use one kind of run-time library and another file to use another kind (for example, single-threaded versus multithreaded) and tried to link them, you’ll get this warning. You should compile all source files to use the same run-time library. 总之,一句话,lib之间有冲突。需要删除导入的一些libs

版 本 类 型 使用的library 被忽略的library
Release 单线程 libc.lib libcmt.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib
多线程 libcmt.lib libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib
使用DLL的多线程 msvcrt.lib libc.lib, libcmt.lib, libcd.lib, libcmtd.lib, msvcrtd.lib
Debug 单线程 libcd.lib libc.lib, libcmt.lib, msvcrt.lib, libcmtd.lib, msvcrtd.lib
多线程 libcmtd.lib libc.lib, libcmt.lib, msvcrt.lib, libcmtd.lib, msvcrtd.lib
使用DLL的多线程 msvcrtd.lib libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, libcmtd.lib

例如编译Release版本的单线程的工程,在linker的命令行加入如下的参数: /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib

当然,通过VC6.0的开发环境也可以配置。选择Project -> Setting,出现Project Setting对话框,单击Link标签,在Category下拉菜单中选择Input,在下方的Ignore libraries: 输入框中输入“被忽略的library”框中对应的libs。输入时注意当前Build是什么版本,libs之间用“,”隔开。“Ingore all default libraries”不能勾选。

————————————————————————————————————————————————————————————————

忽略它。
LIBCMT.lib是你的工程中设定了多线程、静态连接的编译选项而出现的。系统却省的库为单线程、静态连接。所以,在连接的时候会出现此警告。
同样,如果采用多线程、动态连接,则会出现MSVCRT的警
告。

  评论这张
 
阅读(1473)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018