结合本地DLL和组装成一个DLL [英] Combine native DLL and assembly into a single DLL

查看:136
本文介绍了结合本地DLL和组装成一个DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前编程C ++和C#。使用本机C ++的数值计算的部分。

I am currently programming in C++ and C#. Using native C++ for the numerical computing part.

本来我打算用C ++ / CLI进行包装的原生C ++类,但我发现它会导致2至4倍放缓。

Originally I intended to use C++/CLI to make a wrapper to the native C++ classes, but I found it would result in a 2 to 4 times slowdown.

所以,我决定编译我的本地C ++到DLL并通过的P / Invoke调用.NET / C# 。我会做数据preprocessing在C#和数字运算的原生DLL。

So I decided to compile my native C++ to a DLL and call in .NET/C# via P/Invoke. I will do data preprocessing in C# and number crunching in the native DLL.

现在的问题是,当我发表我的作品供其他人使用,我想它是一个单一的DLL。

The problem is that when I deliver my work for others to use, I'd like it to be a single DLL.

这可能吗?顺便说一句,我有所有的源$ C ​​$ C到本地C ++。

Is this possible? BTW, I have all source code to the native C++.

推荐答案

您可以混合在同一个汇编语言在.NET中而不是自然。我想避免这种情况,除非绝对必要的。

You can mix languages in the same assembly in .NET but not naturally. I would avoid this unless absolutely necessary.

请参阅:

<一个href="http://www.hanselman.com/blog/MixingLanguagesInASingleAssemblyInVisualStudioSeamlesslyWithILMergeAndMSBuild.aspx" rel="nofollow">http://www.hanselman.com/blog/MixingLanguagesInASingleAssemblyInVisualStudioSeamlesslyWithILMergeAndMSBuild.aspx

我把组件从不同的语言区分开来。

I keep assemblies from different languages separate.

这篇关于结合本地DLL和组装成一个DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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