Fixed to build and use with MinGW

Fixed to build and use with MinGW