I think this first error may be a key to the mystery.
pnglibconf.h:199:54: error: expected identifier or '(' before '-' token
0
^
What's on that line? It might be something unpalatable for windows.
Thanks!
I've opened the file in Notepad++, noticed some strange symbols, that are not shown in basic Windows Notepad, deleted them and it worked!