Building a shared library using gcc on Linux and MinGW on Windows

view story

http://stackoverflow.com – I'm having trouble with generating a build setup that allows shared libraries to be built in both Linux and Windows using gcc and MinGW, respectively. In Linux, a shared library doesn't have to resolve all dependencies at compile time; whereas, this appears to the case in Windows. Here is the problem setup: $ cat foo.h #ifndef FOO_H #define FOO_H void printme(); #endif $ cat foo.c #include "foo.h" #include <stdio.h> void printme() { printf("Hello World!\n"); } $ cat bar.h #ifndef BAR_H #define BAR_H void printme2(); #endif $ cat bar.c #include "bar.h" #include "foo. (HowTos)