Updated to compile under Windows. Tested with Windows 7 64-bit.