This pull request combined all the patches / threads i could find for making build on windows work.

Just added the PR incase its any help getting the changes in.