解决VC6.0中编译程序时的警告:warning LNK4098
warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
这是由于同一个程序中使用了不同版本的链接库。
解决此问题可以在设置中忽略掉相应的库即可。
方法是在菜单:Project -> Settings...
选择"Link"中的"Input",在"Ignore libraries"中输入要忽略掉的库名称。
需要忽略的库的名字,根据 Settings中"C/C++"的"Code Generation"选项卡下的"Use run-time library"的设置有关:
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
详细请看MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/lnk4098.asp
文章评论
共有 3 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面