Port to windows MinGW

Port to windows MinGW