--- a/src/libs/installer/abstractarchive.h
+++ b/src/libs/installer/abstractarchive.h
@@ -36,8 +36,10 @@
 #include <QDataStream>
 #include <QPoint>
 
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_CC_MINGW)
 typedef int mode_t;
+#elif defined(Q_CC_MINGW)
+#include <sys/stat.h>
 #endif
 
 namespace QInstaller {
--- a/src/libs/3rdparty/libarchive/config/win/config.h
+++ b/src/libs/3rdparty/libarchive/config/win/config.h
@@ -1318,7 +1318,9 @@
 #define id_t short
 
 /* Define to `int' if <sys/types.h> does not define. */
+#ifndef __MINGW32__
 #define mode_t unsigned short
+#endif
 
 /* Define to `long long' if <sys/types.h> does not define. */
 /* #undef off_t */
