自动换行c ++ dll到c# [英] Auto wrap c++ dll into c#

查看:146
本文介绍了自动换行c ++ dll到c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在c#项目中使用c ++库。是否有自动导入所有类的包装工具?

I want to use c++ library in a c# project. Is there any wrapper tool to import all classes automatically?

推荐答案

SWIG 可以帮助创建由两个部分组成的包装器,一个C ++边和一个C#边。

它需要一些工作来设置正确的生成文件。

SWIG can help create a wrapper consisting of two parts, one C++ sided, and one C# sided.
It needs a bit of work to set up the correct generation files though.

需要更多手动编码的替代方法是C ++ / CLI。

An alternative that requires more manual coding is C++/CLI.

apis我喜欢p /调用任何一个。有一个程序来自动转换c头。如果我记得正确,它叫做P / Invoke Interop Assistant或Interop Signature Toolkit。

For pure c apis I prefer p/invoke over either of them. There is a program to automate conversion of c headers. If I recall correctly it's called something like "P/Invoke Interop Assistant" or "Interop Signature Toolkit".

还有 mono / cxxi 看起来很酷。

这篇关于自动换行c ++ dll到c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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