简体   繁体   English

即使设置为 MTd,项目也使用 MDd 编译

[英]Project compile with MDd even when setting to MTd

I'm trying to compile an exe that depends on some other static projects.我正在尝试编译一个依赖于其他一些 static 项目的 exe。 Some of the projects depends on OpenCV libraries that compiled with MTd runtime library option.一些项目依赖于使用MTd运行时库选项编译的 OpenCV 库。 What I did is to set the runtime library of all my projects to MTd (in the runtime library option on visual studio project's properties) as well.我所做的是将我所有项目的运行时库也设置为MTd (在 Visual Studio 项目属性的运行时库选项中)。 When I compile only the static projects everything going well, but when I compile the exe file I get an error like this:当我只编译 static 项目时一切顺利,但是当我编译 exe 文件时,我收到如下错误:

Transform_Static.lib (Transform.obj: error LNK2038: mismatch detected for 'Runtime Library' value 'MDd_DynamicDebug' dosen't match value 'MTd_StaticDebug' in Math_UT.obj

I tried to add/remove libs from the linker dependencies of the exe project but nothing change, what else can I do?我试图从 exe 项目的 linker 依赖项中添加/删除库,但没有任何改变,我还能做什么? thanks.谢谢。

First, You could check if Runtime Library is MTd .首先,您可以检查Runtime Library是否为MTd

Then, you could clean the project and rebuild the project.然后,您可以清理项目并重建项目。

Also, you could refer to Microsoft Docs about LNK2038 and the similar question .此外,您可以参考 Microsoft Docs 关于LNK2038类似问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SetErrorMode和/ MDd(/ MTd)编译标志 - SetErrorMode and /MDd (/MTd) compile flag / MTd会分解断点而不是/ MDd - /MTd will triger a breakpoint but not /MDd 在同一Visual Studio解决方案中使用\\ MDd和\\ MTd? - Using \MDd and \MTd in the same visual studio solution? 编译cuda文件错误:“运行时库”值不匹配“ MDd_DynamicDebug”与vectorAddition_cuda.o中的值“ MTd_StaticDebug”不匹配 - Compile cuda file error: “runtime library” mismatch value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in vectorAddition_cuda.o 链接Visual Studio 2008 Express'/ Mtd'设置时加速崩溃 - Boost crash when linking Visual Studio 2008 Express '/Mtd' setting 是否可以创建一个静态库(单个.lib文件),以后可以用/ MT,/ MTd,/ MD或/ MDd编译? - Is it possible to create a static library (single .lib file) that can be later compiled with either /MT, /MTd, /MD or /MDd? Visual Studio:如何为链接器指定不同的运行时库? (/ MTd,MDd等) - Visual Studio: How to specify different runtime libraries for the linker? (/MTd, MDd, etc) 尝试编译qt项目时编译错误 - Compile error when trying to compile a qt project 切换到/ MDd时,_initp_misc_cfltcvt_tab和_FPinit - _initp_misc_cfltcvt_tab and _FPinit when switching to /MDd std :: ifstream设置fail()即使没有错误 - std::ifstream setting fail() even when no error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM