https://blog.csdn.net/longlijun/article/details/7331093

libcmt.lib是windows环境下vc提供的静态运行时库(多线程);msvcrt.lib是动态运行时库。

原因

由于DLL(或EXE)工程设置的Runtime Library 和 它导入的其他(.lib)库的Runtime Library不同。

比如: 下面为Release版,其中Runtime Library和use of MFC 需要匹配(所以这两个内容的设置是两两对应的)

类型 我的DLL工程 需要调用的lib库的工程 结果
工程名 DShow_Graph Baseclasses ——
use of MFC Use MFC in a static Library Use MFC in a static Library ——
Runtime Library Multi_threaded(/MT) Multi_threaded(/MT) 不冲突
use of MFC Use MFC in a static Library Use MFC in a shared DLL ——
Runtime Library Multi_threaded(/MT) Multi_threaded DLL(/MTd) 冲突
use of MFC Use MFC in a shared DLL Use MFC in a static Library ——
Runtime Library Multi_threaded DLL(/MTd) Multi_threaded(/MT) 冲突
use of MFC Use MFC in a shared DLL Use MFC in a shared DLL ——
Runtime Library Multi_threaded DLL(/MTd) Multi_threaded DLL(/MTd) 不冲突

如果是Debug版本,只需要将上面的设置改为debug下的对应设置后,对应起来理解就可以了


解决方法

  • 把在编译两个工程时,把两个运行库都改为统一的(都是(/MT)或都是(/MTd)),这样就能顺利编译通过了。

 

相关文章:

  • 2022-01-16
  • 2022-02-13
  • 2022-02-07
  • 2021-07-18
  • 2021-08-18
  • 2021-06-11
  • 2021-05-20
猜你喜欢
  • 2021-07-29
  • 2021-10-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-30
  • 2021-09-21
相关资源
相似解决方案