A quick note if you are using Cygwin/X with putty or an ssh client not running within the cygwin environment:
That's from the FAQ.
A solution is to create a shortcut to Xwin.exe (located in the bin directory of cygwin installation path) either to the desktop or task bar and edit the Target in the shortcut's properties to:
C:\cygwin64\bin\XWin.exe -multiwindow -listen tcp -silent-dup-error
The listen option is the one that resolves errors like "Cannot open display XX:0".
There is also a script which sets up more stuff, check the FAQ above.
Since X server 1.17, by default the server does not listen for TCP/IP connections, only accepting local connections on a unix domain socket.
That's from the FAQ.
A solution is to create a shortcut to Xwin.exe (located in the bin directory of cygwin installation path) either to the desktop or task bar and edit the Target in the shortcut's properties to:
C:\cygwin64\bin\XWin.exe -multiwindow -listen tcp -silent-dup-error
The listen option is the one that resolves errors like "Cannot open display XX:0".
There is also a script which sets up more stuff, check the FAQ above.