The dynamic libraries extension is available for the ns-allinone-2.33 release, with support existing in ns-2 from the ns-2.33 release.
It has been tested on Linux i386, Linux x86_64, and Cygwin (32-bit) systems. It has not been tested with OS X and likely further extensions are necessary.
The best way to use the system in Cygwin is to install the ns-allinone-2.33 release, since there have been two small patches to the tcl.m4 files in the tcl and tk directories.
If you are using an older version of ns-2, one of the below patches may work: http://www.dei.unipd.it/%7Ebaldo/ns_dl_patch/Download.html