John's fix to undefined issues
Resolved merge conflict caused by pulling Padraig's windows changes.
Modified Makefiles for Windows+cygwin build.
Removed derived files.