Using Mono.NET Library on Linux

First of all, I would like to point out that I have no experience using Mono.NET, so bear with me if the questions are stupid.

I am working on an application written in C ++ and it works on Windows (VS2008) and Linux / Mac (gcc). There is a library I want to integrate with, which is currently compiled into MS.NET (version 2.x).

I researched and found that I can call the library using the CCW interface that MS provides. Therefore, there should not be too many implementation problems on Windows.

My question is: if I manage to compile the library with Mono.NET on Linux or Mac, how would I call this code from my native application? I think a shorter question may be, is it possible to compile libraries with the Mono compiler, which can be called from native C ++ code on platforms other than Windows?

Thank!

+3
source share
1 answer

Yes, but you need to embed Mono . Your own host application would have to initialize the Mono runtime and then search and execute MonoMethods in MonoObjects.

, - P/Invoke C API (.. extern "C", ++) Mono Mono C. , IMO # "", interop API ++.

, , , P/Invoke.

, "" # - , IntPtr () #, # # , , .

+5

Source: https://habr.com/ru/post/1763902/


All Articles