Modified to compile with MinGW 4.8.2 from Qt package.