After finding dozens of examples how to call native library function from
mono code, i have given up finding an example for how to call a function in
a mono library from a native C-program. I do see lots of API function in the
mono documentation, but I am not able to build an example out of these. Say,
I have written a program DotNetCode.cs like:

public class ExampleClass
{
   public static int ExampleFunction(int n) { return 2*n; }
}

and compiled it with

mcs -t:library DotNetCode.cs to get a file DotNetCode.dll.

What would a native C-Programm (for Linux or Solaris) look like that could
call the defined ExampleFunction?
Probably somethin like

#include <mono/...>
int main(int argc, char **argv)
{
  ...
  ExampleFunction = mono....(...);
  ...
  printf("%d\n",ExampleFunction(2));
}

There should be a tiny example for this somewhere. Maybe there is, but I
don't know the terminology to search for.

Could anybody help me, please?

-- 
View this message in context: 
http://www.nabble.com/How-to-Call-Mono-Librray-Function-from-Native-C-Code-tp19346311p19346311.html
Sent from the Mono - General mailing list archive at Nabble.com.

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to