Without dlfcn: http://pastebin.com/AKvqnjr4
With dlfcn: http://pastebin.com/8vJYDUBp
There are many missing or conflicting declarations, e.g.:
```
D:/msys64/usr/include/sys/types.h:129:18: error: conflicting declaration 'typedef long int time_t'
typedef TIME_T time_t;
^~~~~~
...
D:/msys64/mingw64/x86_64-w64-mingw32/include/crtdefs.h:138:20: note: previous declaration as 'typedef time64_t time_t'
typedef time64_t time_t;
```