intel编译器:libc.lib和msvcrt.lib冲突?如何解决 2010-9-28 18:13
来源:互联网 发布:sql count group by 编辑:程序博客网 时间:2024/05/22 19:38
现在开发directshow有点不合时宜了,快淘汰了嘛。我在visual studio 2008下开发filter的时候,参照了vc6的一些设置,结果就遇到了很多冲突问题。比如现在这个就很典型:libcmt.lib和msvcrt.lib。
warning LNK4098: defaultlib ‘LIBCMT’ conflicts with use of other libs; use /NODEFAULTLIB:library
这两个玩意儿在编译的时候是warning。一般我不大管warning,能编译成功就好了嘛。这次栽了。在自己的电脑上测试还行,如果上别人的没有visual studio 2008或2005的电脑上,就会报这样的错误:
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
应该说是找不到某些dll(听说就是MSVCR80.DLL,不是谁都有的)吧。我在msdn上找到些解释:
Important The run-time libraries now contain directives to prevent mixing different types. You’ll receive this warning if you try touse different types or debug and non-debug versionsof the run-timelibrary in the same program. For example, if you compiled one file touse one kindof run-timelibrary and another file touse another kind (for example, single-threaded versus multithreaded) and tried to link them, you’ll get this warning. You should compile all source files touse the same run-timelibrary. See theUse Run-TimeLibrary (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 tabof the Settings dialog box in Developer’s Studio or by using the /NODEFAULTLIB:library optionwith LINK for eachlibrary you want to ignore. See theIgnore Libraries (/NODEFAULTLIB) linker option for more information.
The table below shows which libraries should be ignored depending on which run-timelibrary you want touse.
To use this run-time libraryIgnore these librariesSingle-threaded (libc.lib)libcmt.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.libMultithreaded (libcmt.lib)libc.lib, msvcrt.lib, libcd.lib, libcmtd.lib, msvcrtd.libMultithreaded using DLL (msvcrt.lib)libc.lib, libcmt.lib, libcd.lib, libcmtd.lib, msvcrtd.libDebug Single-threaded (libcd.lib)libc.lib, libcmt.lib, msvcrt.lib, libcmtd.lib, msvcrtd.libDebug Multithreaded (libcmtd.lib)libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, msvcrtd.libDebug Multithreaded using DLL (msvcrtd.lib)libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, libcmtd.lib
就是说在设置Use Real-time Library的时候要选/Multi-threaded (/MT),这样就不会用到msvcrt.lib。然后根据那张表:要在Ignore Specific Library里面加上它们(如果是参照vc6来设置lib的话,有些教程上讲要加上msvcrtd.lib,其实并不需要)。msvcrt.lib是冲突源头,为什么?我不清楚,呵呵,推荐一篇文章:http://www.cnblogs.com/jedimaster/archive/2007/03/02/662065.html
- intel编译器:libc.lib和msvcrt.lib冲突?如何解决 2010-9-28 18:13
- msvcrt.lib 和 libc.lib的冲突
- msvcrt.lib和LIBCD.lib链接冲突
- libcmt.lib和msvcrt.lib冲突
- LNK2005 libcmt.lib和msvcrt.lib冲突
- libcmt.lib和msvcrt.lib冲突,原因和解决方法
- error 2005:libcmtd.lib和msvcrt.lib冲突
- LIBC.lib冲突
- libcmt.lib、msvcrt.lib冲突的主要原因
- 关于zlib.lib库和msvcrt.lib库链接冲突的问题
- MSVCRT.lib与LIBCD.lib编译冲突解决办法
- VS中解决LIBCMTD.lib和uafxcwd.lib冲突(uafxcw.lib LIBCMT.lib冲突)
- VS中解决LIBCMTD.lib和uafxcwd.lib冲突(uafxcw.lib LIBCMT.lib冲突)
- 如何解决OpenCv附带的Zlibd.lib和Zlibstat.lib冲突
- 问题:无法打开文件"LIBC.lib" 解决
- 解决/lib/libc.so.6: not found
- visual studio链接过程中libcmtd.lib与MSVCRT.lib冲突
- msvcrtd.lib和libcmtd.lib冲突
- 关于不同的程序入口,main(), _tmain(),WinMain(),wmain()?
- 图像像素操作
- Ural1068
- 60-思考题(4)-将1到9 这九个数字分成若干个数,满足一定的算式
- 看到这样的报道我心凉了
- intel编译器:libc.lib和msvcrt.lib冲突?如何解决 2010-9-28 18:13
- Cannot set device tcp segmentation offload settings: Invalid argument
- udev mdev
- esclipse debug
- 栈的简单实现
- winform tabcontrol控件的标签放到左边后,文字成是上下显示的
- 算法系列之二: 三只水桶等分水问题
- ZigBee学习笔记_zmain_vdd_check()
- c++ virtual function 虚函数