updated for MinGW build