building dll with GCC http://stackoverflow.com/questions/16332701/how-to-call-c-dll-in-c-sharp http://www.adp-gmbh.ch/cpp/gcc/create_lib.html
first we have C code
#include <stdio.h>
int
hello()
{
printf ("Hello World!\n");
}
we need to compile to dll for use First compile mydll.c to object code:
$ gcc -c mydll.c
Then, tell gcc that it is building a shared library:
$ gcc -shared -o mydll.dll mydll.o