为什么/ clr与Visual Studio中的/ mt和/ mtd不兼容? [英] Why is /clr incompatible with /mt and /mtd in Visual Studio?

查看:1511
本文介绍了为什么/ clr与Visual Studio中的/ mt和/ mtd不兼容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以任何人请解释我如何和为什么/ clr与/ mtd不兼容?
这是什么替代方法?如果我使用/ md或/ mdd,内部会发生什么?

can anybody please explain for me how and why /clr is incompatible with /mtd ? What is the alternative for this? What happens internally if I use /md or /mdd ?

据我所知,我们不会合并使用/ clr和/ mtd。有人可以解释一下是否有办法做到这一点?请解释一下为什么/ clr与Visual Studio中的/ mt和/ mtd不兼容。

As far as I know we don't combinedly use /clr and /mtd. Can someone explain if there is a way to do this? And please explain me how and why /clr is incompatible with /mt and /mtd in Visual Studio?

推荐答案

此处提供:


如果您使用/ clr编译器
开关,您的代码将与
链接到一个导入库msvcmrt.lib。
导入库引用了一个新的
库msvcm80.dll,它在托管代码和原生CRT之间提供
代理。您不能将/ b $ b静态链接的CRT(/ MT或/ MTd
选项)与/ clr一起使用。请使用
动态链接库(/ MD或
/ MDd)。

If you are using the /clr compiler switch, your code will be linked with an import library, msvcmrt.lib. The import library references a new library, msvcm80.dll, which provides a proxy between your managed code and the native CRT. You cannot use the statically linked CRT ( /MT or /MTd options) with /clr. Use the dynamically-linked libraries (/MD or /MDd) instead.

导致你的代码引用一个新的DLL msvcm80.dll - 这充当您的托管代码和CRT之间的代理。很难说这个代理是什么,但我想它作为一个接口在托管堆,垃圾回收,托管线程和这种事情的分配。如果你链接CRT的静态版本,那么代理将无法拦截你对运行时库的调用。

The /clr flag causes your code to reference a new dll msvcm80.dll - this acts as a proxy between your managed code and the CRT. It's difficult to say exactly what this proxy does, but I guess it acts as an interface for allocations on the managed heap, garbage collection, managed threads and that kind of thing. If you link the static versions of the CRT, then the proxy would not be able to intercept your calls to the runtime libraries.

这篇关于为什么/ clr与Visual Studio中的/ mt和/ mtd不兼容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆