加入htmlHelp.lib及包含htmlhelp.h文件就出现LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NOD

fromair 2003-10-18 05:08:06
在我的工程中加入htmlHelp.lib及包含htmlhelp.h文件就出现LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library要如何解决?
thanks
...全文
142 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
ltbcn 2003-12-09
  • 打赏
  • 举报
回复
顶一下
bluehawaii 2003-11-10
  • 打赏
  • 举报
回复
defaultlib 'library' conflicts with use of other libs; use /NODEFAULTLIB:library

You are trying to link with incompatible libraries.

Note The run-time libraries now contain directives to prevent mixing different types. You will 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 will 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 incorrect run-time libraries by using /NODEFAULTLIB for each library you want to ignore.

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


--------------------------------------------------------------------------------

Microsoft Product Support Knowledge Base Link

Send feedback on this topic to Microsoft

© Microsoft Corporation. All rights reserved.
scatzr 2003-10-21
  • 打赏
  • 举报
回复
不用去管它,是htmlhelp.lib和defaultlib中有命名冲突。
fromair 2003-10-18
  • 打赏
  • 举报
回复
MY GOD:
加了之后出现2000多个error LNK2001: unresolved external symbol!!!
luwenguang 2003-10-18
  • 打赏
  • 举报
回复
Project-->Setting...->Link-->Project Options->

add :/NODEFAULTLIB

15,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧