/ clr:纯粹的非托管lib [英] /clr:pure and unmanaged lib

查看:42
本文介绍了/ clr:纯粹的非托管lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小的C ++ / CLI应用程序,它调用一个非托管的lib。


好​​像我不能使用/ clr:pure并且链接到非托管的lib(LNK1313)

错误)。


我遇到的问题是使用/ clr编译会增加几个依赖

msvc * .dll :s会给安装增加一些不必要的复杂性。


如果没有显式的p / invoke,是否可以避免msvc * .dll依赖?

I have a small C++/CLI application which calls an unmanaged lib.

It seems like I can''t use /clr:pure and link with the unmanaged lib (LNK1313
error).

The problem I have is that compiling with /clr adds a dependency on several
msvc*.dll:s which adds some unwanted complexity to the installation.

Is it possible to avoid the msvc*.dll dependency without explicit p/invoke?

推荐答案



" wpcmame" < wp ***** @ discussion.microsoft.com写信息

news:05 *********************** *********** @ microsof t.com ...

"wpcmame" <wp*****@discussions.microsoft.comwrote in message
news:05**********************************@microsof t.com...

>我有一个小的C ++ / CLI应用程序,它调用一个非托管的lib 。


好​​像我不能使用/ clr:pure和链接非托管lib

(LNK1313

错误)。
>I have a small C++/CLI application which calls an unmanaged lib.

It seems like I can''t use /clr:pure and link with the unmanaged lib
(LNK1313
error).



当然。 / clr:pure意味着你的程序集只包含MSIL,但是你从本机库中输入机器代码是

Of course. /clr:pure means your assembly contains only MSIL, but you''re
putting in machine code from a native library.


> ;

我遇到的问题是用/ clr编译会增加依赖

几个

msvc * .dll:s会增加一些不需要的东西安装的复杂性。


如果没有明确的

p / invoke,是否可以避免msvc * .dll依赖?
>
The problem I have is that compiling with /clr adds a dependency on
several
msvc*.dll:s which adds some unwanted complexity to the installation.

Is it possible to avoid the msvc*.dll dependency without explicit
p/invoke?



编号但是这不应该让任何人感到惊讶,如果你为.NET编译,你将需要安装.NET运行时。
需要安装.NET运行时。 .NET运行时是使用C ++构建的,因此它需要部署msvc * .dll


现在整个并排版本问题是另一个故事。我认为如果MS在.NET 2.0运行时补丁中部署C ++更新,可能会修复
,但是由于某些原因他们坚持分发旧版本的库

(即使新的兼容并包含错误修复)。

No. But this shouldn''t surprise anyone, if you compile for .NET you will
need the .NET runtime installed. The .NET runtime is built using C++, so it
deploys msvc*.dll

Now the whole side-by-side versioning problem is another story. I think it
might be fixed if MS deployed the C++ updates in a .NET 2.0 runtime patch,
but for some reason they insist on distributing old versions of the library
(even though the new ones are compatible and include bug fixes).


嗨Ben!
Hi Ben!

>如果没有明确的
p / invoke,是否可以避免msvc * .dll依赖?
>Is it possible to avoid the msvc*.dll dependency without explicit
p/invoke?



编号但是这不应该让任何人感到惊讶,如果你为.NET编译,你将需要安装.NET运行时。
需要安装.NET运行时。 .NET运行时是使用C ++构建的,因此它需要部署msvc * .dll


No. But this shouldn''t surprise anyone, if you compile for .NET you will
need the .NET runtime installed. The .NET runtime is built using C++, so it
deploys msvc*.dll



????


.NET运行时不依赖于msvc * .dll!

只有在C ++ / CLI中使用/ clr进行编译时,您的应用程序才会

取决于CRT!


.NET运行时不会降低msvc * .dlls ....


- -

问候

Jochen


我关于Win32和.NET的博客
http://blog.kalmbachnet.de/


" Jochen Kalmbach [MVP]" < no ******************** @ holzma.dewrote in message

新闻:eY ********** *** @ TK2MSFTNGP02.phx.gbl ...
"Jochen Kalmbach [MVP]" <no********************@holzma.dewrote in message
news:eY*************@TK2MSFTNGP02.phx.gbl...

嗨Ben!
Hi Ben!

>>是否可以在没有明确的
p / invoke的情况下避免msvc * .dll依赖?
>>Is it possible to avoid the msvc*.dll dependency without explicit
p/invoke?


不。但是这不应该让任何人感到惊讶,如果你为.NET编译,你将需要安装.NET运行时。 .NET运行时是使用C ++构建的,所以
它部署了msvc * .dll


No. But this shouldn''t surprise anyone, if you compile for .NET you will
need the .NET runtime installed. The .NET runtime is built using C++, so
it deploys msvc*.dll



????


.NET运行时不依赖于msvc * .dlls!

只有在C ++ / CLI中使用/ clr进行编译时,您的应用程序才会是
取决于CRT!


.NET运行时不会降低msvc * .dlls ....


????

The .NET runtime does not depend on the msvc*.dlls!
Only if you compiler in C++/CLI with "/clr", then your application will
depend on the CRT!

The .NET runtime does not deply msvc*.dlls....



Jochen ,

mscorjit.dll,mscorwks.dll等与MSVCRXX.dll链接,其中XX

代表VC运行时的版本,简单的dumpbin / imports可能显示

你。


威利。

Jochen,
mscorjit.dll, mscorwks.dll etc are linked against the MSVCRXX.dll, where XX
stands for the version of the VC runtime, a simple dumpbin /imports may show
you that.

Willy.


这篇关于/ clr:纯粹的非托管lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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