Exposing an ISO C++ class to C#

后端 未结 3 1642
北荒
北荒 2021-02-19 07:01

I need to expose some C++ classes to C# (I am building on Linux, using mono, so COM is not an option)

The evidence I have gathered so far suggests that the best way to a

3条回答
  •  耶瑟儿~
    2021-02-19 07:18

    Mono has recently made some pretty big strides with C++ interoperability in CXXI (pronounced sexy).

    From this posting, the short story is that the new CXXI technology allows C#/.NET developers to:

    • Easily consume existing C++ classes from C# or any other .NET language
    • Instantiate C++ objects from C#
    • Invoke C++ methods in C++ classes from C# code
    • Invoke C++ inline methods from C# code (provided your library is compiled with -fkeep-inline-functions or that you provide a surrogate library)
    • Subclass C++ classes from C#
    • Override C++ methods with C# methods
    • Expose instances of C++ classes or mixed C++/C# classes to both C# code and C++ as if they were native code.

    CXXI is the result of two summers of work from Google's Summer of Code towards improving the interoperability of Mono with the C++ language.

提交回复
热议问题