intel编译器:libc.lib和msvcrt.lib冲突?如何解决 2010-9-28 18:13

现在开发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-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 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 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

就是说在设置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 C++ 编译器Windows版》(Intel.C.Plus.Plus.Compiler.v10.0.026)[Bin] 软件版权归原作者及原软件公司所有,如果你喜欢,请购买正版软件 常驻服务器 : DonkeyServer No2, 7x24, 根据工作需要暂停 [版本说明] 截止到2007-08-15为最新版, 仅包含Windows平台, 支持 IA32 / Intel64 / IA64处理器 [病毒检测] NOD32 v2.7 2007-08-15 [安装测试] Windows 2003 SP2 / Visual Studio 2005 SP1 [产品主页] [ http://www.intel.com/cd/software/products/...9578.htm ] [产品简介] 个人翻译, 以原版英文为准: 概要: -------------------------------------------------------------------------------- Intel C++编译器专业版为创建多线程应用程序提供最好的支持。只有专业版才提供对高级优化、多线程和处理器支持(?)。包括自动处理器派发、向量化、自动并行处理、OpenMP*、数据预取、循环展开,还有为并行化、数学运算和多媒体库而高度优化的C++模版。 专业版把高效的编译器Intel® Threading Building Blocks (Intel® TBB), Intel® Integrated Performance Primitives (Intel® IPP) and Intel® Math Kernel Library (Intel® MKL)整合到了一起。虽然这些库也可以单独获取,但是专业版在一个显著折扣价位上为构建稳定高效的并行代码提供了一个强大的基础。 标准版编译器和专业版有着相同的效能和特性, 但是不提供多线程库。 特性: -------------------------------------------------------------------------------- 效能: 考虑使用Intel C++编译器专业版来最佳化效能。内间的优化技术和多线程支持帮助您创建可以在最新的多核处理器上运行best的代码。 高级优化特性: 使用IntelC++编译器Windows版编译的软件可以受益于高级优化特性, 这里有一些简要介绍, 并且链接到完整描述: * Multi-Threaded Application Support, including OpenMP and auto-parallelization for simple and efficient software threading. * Auto-vectorization 并行化代码来利用最新处理器的SSE指令集构架(SSE, SSE2, SSE3, SSSE3, and SSE4)。 * High-Performance Parallel Optimizer (HPO)(高效能并行优化器) 重新组织和优化循环来确定auto-vectorization, OpenMP, or auto-parallelization 最好的利用处理器的缓存、内存访问、SIMD指令集和多核能力。这个由10.0版本而来得新的革命性的能力,组合了向量化、并行化和循环转化到一个比先前分散模块更快、更有效率和更可靠的单个过程。 * Interprocedural Optimization (IPO) 大幅的改善了被频繁使用的中小规模函数的效能,尤其是在循环内包含调用的程序。这个优化器的分析能力还可以对代码弱点和代码错误给出反馈,诸如未初始化的变量或者OpenMP API issues这些严格依赖编译器前端的编译器不能检测到的状况。 * Profile-guided Optimization (PGO) 通过减少指令缓存thrashing、重新组织代码布局、收缩代码大小和降低分支预测失败来改善程序效能。 * Optimized Code Debugging with the Intel® Debugger(使用Intel调试器调试优化后的代码)改善了为Intel架构优化代码的调试过程的效率. 本版本新特性: -------------------------------------------------------------------------------- 此Intel C++编译器Windows版本构建于一个winning foundation之上。它使您能够为下一代硬件创建下一代应用。 改善的效能和Threading * 新的并行/循环优化器 * 改善的C++优化 * 异常处理和类层次分析 安全监测和诊断 * 缓冲区溢出静态验证 * OpenMP API 验证 VISTA 和 Visual Studio 2005 支持 优化报告 支持最新的多核处理器 * Intel® Core™2 Duo processor * Intel® Core™2 Quad processor * Quad-Core Intel® Xeon® processor 5300 series * Dual-Core Intel® Xeon® processor 3000 series * Dual-Core Intel® Xeon® processor 5000 series * Dual-Core Intel® Xeon® processor 7000 series * Dual-Core Intel® Itanium® 2 processor 提供专业版本 Advanced Optimization Features in Depth -------------------------------------------------------------------------------- ... ... 兼容性和适应性 -------------------------------------------------------------------------------- ... ... 可与Microsoft Visual Studio 2005, Visual Studio .NET 2002/2003, and Visual Studio 98集成,并提供扩展的32位和64位多核Intel处理器支持。 Intel C++ 编译器提供下列语言一致性 * ANSI/ISO C 语言标准一致性 (ISO/IEC 9899:1990) * ANSI/ISO C++语言标准一致 (ISO/IEC 14882:1998) * OpenMP 规范版本 2.5 系统需求
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值