Warning LNK4098 : defaultlib "library" conflicts with use of other libs; use /NODEFAULTLIB:library
来源:互联网 发布:魔兽世界多玩数据库 编辑:程序博客网 时间:2024/04/29 20:57
关键字:Warning LNK4098
defaultlib "library" conflicts with use of other libs; use /NODEFAULTLIB:library
工程一大,包含的头文件和库也就多了,冲突一时是不可避免的。 不过还好, 只是Warning,并不影响整个工程的编译和运行。但是一些项目就要求尽量不出现Warning,因为你不知道将来项目的Bug会不会是由此而引起。严格,未雨绸缪,总是一件好事。谁也不想将来的某个时候去Debug N年前的玩意。 痛苦啊~~
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”不能勾选。
- Warning LNK4098 : defaultlib "library" conflicts with use of other libs; use /NODEFAULTLIB:library
- Warning LNK4098 : defaultlib "library" conflicts with use of other libs; use /NODEFAULTLIB:library
- LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
- LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
- LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
- warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
- warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
- warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; use /NODEFAULTLIB:library
- warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
- LNK4098 defaultlib 'library' conflicts with use of other libs; use /NODEFAULTLIB:library
- VC 调试小记之--warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
- LINK:warning LINK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
- LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:librar
- LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:librar
- LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:librar
- defaultlib "library" conflicts with use of other libs; use /NODEFAULTLIB:library
- defaultlib "library" conflicts with use of other libs; use /NODEFAULTLIB:library
- 出现警告"defaultlib "library" conflicts with use of other libs; use /NODEFAULTLIB:library ."
- 开发基于ASP.NET的自定义日志系统
- [转]DELPHI程序的调试与异常处理
- C#中TreeView组件使用方法初步
- 上机签到:信息检索技术 04图档1 第十三次
- 受益良多的东东!
- Warning LNK4098 : defaultlib "library" conflicts with use of other libs; use /NODEFAULTLIB:library
- TCL/EXPECT自动化测试脚本实例六 --- SNMP community长度测试
- 如何建立Linux下的ARM交叉编译环境(他人)
- 取CPU号,硬盘号,网卡号
- C++字符串完全指南(转载)
- 河北省高校名单
- Dom4j学习笔记---FAQ
- 全国普通高校名单
- 世界是心的镜子