質問

I have used mono --aot=full to compile a small program I wrote under linux and it has produced a .so file. I read up on these and found that they are actually libraries and not executables, and I was wondering how I could link to these libraries in a c program so that I could use the methods I wrote in c sharp in the c program?

Thanks in advance.

役に立ちましたか?

解決

The --aot=full switch product is an .so file that has the pre-compiled bytecodes. It depends on platform and run native instructions but it still needs the CLR (Mono Runime) to do the thread & task managements and other .NET platform operations.

If what you need it to call Native (C#) methods from your non-managed (C/C++) program you are looking for these resources:

  • Native interop rules for mono This link shows how to call native (C/C++) methods from your C# program, but it also have all the type compatibility you will need for your endeavor;
  • Embedding Mono This link shows how to start the Mono Runtime from within your C/C++ code and how to call managed code after that;
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top