问题描述
我想在c#项目中使用c ++库。是否有自动导入所有类的包装工具? 可以帮助创建一个由两部分组成的包装器,一个是C ++边框,另一个是C#面。_
需要一些工作来设置正确的生成文件。
需要更多手动编码的替代方法是C ++ / CLI。
对于纯c apis我更喜欢p /调用其中任何一个。有一个自动转换C头的程序。如果我记得正确,它被称为P / Invoke Interop Assistant或Interop Signature Toolkit。
还有一个,看起来很酷。
I want to use c++ library in a c# project. Is there any wrapper tool to import all classes automatically?
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.
An alternative that requires more manual coding is C++/CLI.
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".
There is also mono/cxxi which looks pretty cool.
这篇关于自动包装c ++ dll到c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!