Calling a UNIX and Linux.so shared object file from C #

Is there a way for a shared object file written in C and built on Unix to be called from C # P / Invoke?

Or do I need to use Java or something like that?

+5
source share
2 answers

Mono has the ability to integrate with native libraries from C #, built on top of dlopen (3). You just need to use the DllImport statement with the library name (ie, "Libform.so.5"), and then wrap your own code and data types with a friendly C # class that will serve all low-level materials. This page contains a good overview with lots of information on how to deal with marshaling pointers and other unsafe types.

Once you have written your wrapper class, you can simply use this without worrying that it uses the built-in shared library below.

+6
source

, , , , # Windows. -, , ABI GNU/linux. , , , C . , , .

linux/Mono, . : UNIX Linux.so #.

, , http://packages.debian.org/lenny/cli-uno-bridge ; , .

+1

All Articles