I used the default Cygwin gcc toolchain as of 2012-03-09.
I applied the following changes to the source, which enable use of libpng12 and xauth:
# nxcomp-3.5.0-2 echo ' 388c388,389 < LIBS="-lstdc++ -lpng -ljpeg -lz" --- > CXXFLAGS="-I/usr/include/libpng12 $CXXFLAGS" > LIBS="-lstdc++ -lpng12 -ljpeg -lz" ' | patch configure.in echo '229c229 < #if defined(__CYGWIN32__) || defined(__APPLE__) --- > #if defined(__APPLE__)' | patch Auth.cpp autoconf-2.13 ./configure make cp -p cygXcomp.dll .. # nxproxy-3.5.0-1 echo ' 162c162 < LIBS="$LIBS -L../nxcomp -lXcomp -lstdc++ -Wl,-e,_mainCRTStartup -ljpeg -lpng -lz" --- > LIBS="$LIBS -L../nxcomp -lXcomp -lstdc++ -Wl,-e,_mainCRTStartup -ljpeg -lpng12 -lz" ' | patch configure.in autoconf-2.13 ./configure make cp -p nxproxy.exe ..
Afterwards, grab the two binaries cygXcomp.dll and nxproxy.exe and put them in the contrib/nx folder of the NXLogin program directory.