Something like this works: winegcc -m32 -shared -o test.dll test.c test.spec The file test.spec has to export your functions e.g: @ stdcall myFunction(ptr long) The test.c file in this case has lets say the prototype: void WINAPI myFunction(void *some_pointer, int value) (Note the calling convention is critical; for int/long/float you use long in the spec file, for any pointer, obviously ptr)