You need to get the PG sources and follow the compile-on-win32
instructions, cygwin alone will not work. You'll end up with client
libraries for pg, both dll and static. I could only link against the
DLL version (libpqdll.lib or something).
I compiled with the cygwin pg-include files and the
win32 library files.