diff --git a/src/libs/7zip/win/CPP/7zip/Common/StreamObjects.cpp b/src/libs/7zip/win/CPP/7zip/Common/StreamObjects.cpp
index 3c86c3a..bb2df17 100644
--- a/src/libs/7zip/win/CPP/7zip/Common/StreamObjects.cpp
+++ b/src/libs/7zip/win/CPP/7zip/Common/StreamObjects.cpp
@@ -78,7 +78,7 @@ Byte *CDynBufSeqOutStream::GetBufPtrForWriting(size_t addSize)
 void CDynBufSeqOutStream::CopyToBuffer(CByteBuffer &dest) const
 {
   dest.SetCapacity(_size);
-  memcpy(dest, _buffer, _size);
+  memcpy(dest, &_buffer, _size); // PQR for MinGW-w64: requires _buffer address here.
 }
 
 STDMETHODIMP CDynBufSeqOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
@@ -205,7 +205,7 @@ STDMETHODIMP CCachedInStream::Read(void *data, UInt32 size, UInt32 *processedSiz
 
   return S_OK;
 }
- 
+
 STDMETHODIMP CCachedInStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
 {
   switch(seekOrigin)
diff --git a/src/libs/7zip/win/CPP/Common/DynamicBuffer.h b/src/libs/7zip/win/CPP/Common/DynamicBuffer.h
index bf52a74..8bf54e7 100644
--- a/src/libs/7zip/win/CPP/Common/DynamicBuffer.h
+++ b/src/libs/7zip/win/CPP/Common/DynamicBuffer.h
@@ -20,7 +20,7 @@ template <class T> class CDynamicBuffer: public CBuffer<T>
     size_t newCap = this->_capacity + delta;
     if (newCap < delta)
       newCap = this->_capacity + size;
-    SetCapacity(newCap);
+    CBuffer<T>::SetCapacity(newCap); // PQR for MinGW-w64: template specification required.
   }
 public:
   CDynamicBuffer(): CBuffer<T>() {};
diff --git a/src/libs/installer/fsengineserver.cpp b/src/libs/installer/fsengineserver.cpp
index 2b2556c..9bcc4a9 100644
--- a/src/libs/installer/fsengineserver.cpp
+++ b/src/libs/installer/fsengineserver.cpp
@@ -60,7 +60,8 @@ bool startDetached(const QString &program, const QStringList &args, const QStrin
     };
 
     const QString arguments = QInstaller::createCommandline(program, args);
-    const bool success = CreateProcess(0, const_cast<wchar_t *>(static_cast<const wchar_t *>(arguments.utf16())),
+    // PQR for MinGW-w64: Parameter #2 was const_cast<wchar_t *>(static_cast<const wchar_t *>(arguments.utf16())).
+    const bool success = CreateProcess(0, (LPWSTR)arguments.utf16(),
         0, 0, FALSE, CREATE_UNICODE_ENVIRONMENT | CREATE_NEW_CONSOLE,
         0, (wchar_t*)workingDirectory.utf16(),
         &startupInfo, &pinfo);
diff --git a/src/libs/kdtools/kdsavefile.cpp b/src/libs/kdtools/kdsavefile.cpp
index d866968..8a8fcbe 100644
--- a/src/libs/kdtools/kdsavefile.cpp
+++ b/src/libs/kdtools/kdsavefile.cpp
@@ -28,7 +28,8 @@
 #include <QtCore/QTemporaryFile>
 
 #ifdef Q_OS_WIN
-# include <io.h>
+    #include <io.h>
+    #include <share.h> // PQR for MinGW-w64: Required for _SH_DENYRW
 #endif
 #include <memory>
 #include <sys/stat.h>
@@ -89,9 +90,11 @@ static QString makeAbsolute(const QString &path)
 static int myOpen(const QString &path, int flags, int mode)
 {
 #ifdef Q_OS_WIN
-    int fd;
-    _wsopen_s(&fd, reinterpret_cast<const wchar_t *>(path.utf16()), flags, _SH_DENYRW, mode);
-    return fd;
+    // PQR for MinGW-w64: _wsopen_s doesn't exist in MSVCRT.dll, let's use _wsopen.
+    return _wsopen(reinterpret_cast<const wchar_t *>(path.utf16()), flags, _SH_DENYRW, mode);
+    //int fd;
+    //_wsopen_s(&fd, reinterpret_cast<const wchar_t *>(path.utf16()), flags, _SH_DENYRW, mode);
+    //return fd;
 #else
     return open(QFile::encodeName(path).constData(), flags, mode);
 #endif
diff --git a/src/libs/kdtools/kdsysinfo_win.cpp b/src/libs/kdtools/kdsysinfo_win.cpp
index 3e99e39..56c545b 100644
--- a/src/libs/kdtools/kdsysinfo_win.cpp
+++ b/src/libs/kdtools/kdsysinfo_win.cpp
@@ -279,7 +279,8 @@ typedef struct _REPARSE_DATA_BUFFER {
 QString junctionTargetPath(const QString &path)
 {
     HANDLE fileHandle;
-    fileHandle = CreateFile(path.utf16(), FILE_READ_EA, FILE_SHARE_READ | FILE_SHARE_WRITE |
+    // PQR for MinGW-w64: Parameter #1 was path.utf16().
+    fileHandle = CreateFile((LPCWSTR)path.utf16(), FILE_READ_EA, FILE_SHARE_READ | FILE_SHARE_WRITE |
                             FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS |
                             FILE_FLAG_OPEN_REPARSE_POINT, NULL);
     if (fileHandle == INVALID_HANDLE_VALUE) {
@@ -313,13 +314,19 @@ QString junctionTargetPath(const QString &path)
         if (reparseStructData->ReparseTag == IO_REPARSE_TAG_SYMLINK){
             realPathLength = reparseStructData->SymbolicLinkReparseBuffer.PrintNameLength / sizeof(WCHAR);
             realPathWCHAR = new WCHAR[realPathLength + 1];
-            wcsncpy_s(realPathWCHAR, realPathLength + 1, &reparseStructData->SymbolicLinkReparseBuffer.PathBuffer[
+            // PQR for MinGW-w64: wcsncpy_s doesn't exist in msvcrt.
+            wcsncpy(realPathWCHAR, &reparseStructData->SymbolicLinkReparseBuffer.PathBuffer[
                 reparseStructData->SymbolicLinkReparseBuffer.PrintNameOffset / sizeof(WCHAR)], realPathLength);
+            //wcsncpy_s(realPathWCHAR, realPathLength + 1, &reparseStructData->SymbolicLinkReparseBuffer.PathBuffer[
+            //    reparseStructData->SymbolicLinkReparseBuffer.PrintNameOffset / sizeof(WCHAR)], realPathLength);
         } else if (reparseStructData->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
             realPathLength = reparseStructData->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
             realPathWCHAR = new WCHAR[realPathLength + 1];
-            wcsncpy_s(realPathWCHAR, realPathLength + 1, &reparseStructData->MountPointReparseBuffer.PathBuffer[
+            // PQR for MinGW-w64: wcsncpy_s doesn't exist in msvcrt.
+            wcsncpy(realPathWCHAR, &reparseStructData->MountPointReparseBuffer.PathBuffer[
                 reparseStructData->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR)], realPathLength);
+            //wcsncpy_s(realPathWCHAR, realPathLength + 1, &reparseStructData->MountPointReparseBuffer.PathBuffer[
+            //    reparseStructData->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR)], realPathLength);
         } else {
             qDebug() << QString::fromLatin1("Path %1 is not a symlink and not a mount point.").arg(path);
         }
diff --git a/src/libs/kdtools/kdupdaterupdateoperations.cpp b/src/libs/kdtools/kdupdaterupdateoperations.cpp
index 6f934ab..fa8f3ce 100644
--- a/src/libs/kdtools/kdupdaterupdateoperations.cpp
+++ b/src/libs/kdtools/kdupdaterupdateoperations.cpp
@@ -104,8 +104,8 @@ void CopyOperation::backup()
 
     setValue(QLatin1String("backupOfExistingDestination"), backupFileName(dest));
 
-    // race condition: The backup file could get created 
-    // by another process right now. But this is the same 
+    // race condition: The backup file could get created
+    // by another process right now. But this is the same
     // in QFile::copy...
     const bool success = QFile::rename(dest, value(QLatin1String("backupOfExistingDestination")).toString());
     if (!success)
@@ -179,9 +179,9 @@ QDomDocument CopyOperation::toXml() const
     // we don't want to save the backupOfExistingDestination
     if (!hasValue(QLatin1String("backupOfExistingDestination")))
         return UpdateOperation::toXml();
-    
+
     CopyOperation *const me = const_cast<CopyOperation *>(this);
-    
+
     const QVariant v = value(QLatin1String("backupOfExistingDestination"));
     me->clearValue(QLatin1String("backupOfExistingDestination"));
     const QDomDocument xml = UpdateOperation::toXml();
@@ -225,8 +225,8 @@ void MoveOperation::backup()
 
     setValue(QLatin1String("backupOfExistingDestination"), backupFileName(dest));
 
-    // race condition: The backup file could get created 
-    // by another process right now. But this is the same 
+    // race condition: The backup file could get created
+    // by another process right now. But this is the same
     // in QFile::copy...
     const bool success = QFile::rename(dest, value(QLatin1String("backupOfExistingDestination")).toString());
     if (!success)
@@ -389,9 +389,9 @@ QDomDocument DeleteOperation::toXml() const
     // we don't want to save the backupOfExistingFile
     if (!hasValue(QLatin1String("backupOfExistingFile")))
         return UpdateOperation::toXml();
-    
+
     DeleteOperation *const me = const_cast<DeleteOperation *>(this);
-    
+
     const QVariant v = value(QLatin1String("backupOfExistingFile"));
     me->clearValue(QLatin1String("backupOfExistingFile"));
     const QDomDocument xml = UpdateOperation::toXml();
@@ -847,7 +847,7 @@ bool ExecuteOperation::performOperation()
     }
 
     QList<int> allowedExitCodes;
-    
+
     QRegExp re(QLatin1String("^\\{((-?\\d+,)*-?\\d+)\\}$"));
     if (re.exactMatch(args.first())) {
         const QStringList numbers = re.cap(1).split(QLatin1Char(','));
@@ -865,7 +865,7 @@ bool ExecuteOperation::performOperation()
         args.pop_back();
 #ifdef Q_OS_WIN
         QString arguments = qt_create_commandline(args.front(), args.mid(1));
-        
+
         PROCESS_INFORMATION pinfo;
 
         STARTUPINFOW startupInfo = { sizeof(STARTUPINFO), 0, 0, 0,
@@ -873,7 +873,8 @@ bool ExecuteOperation::performOperation()
                                      static_cast< ulong >(CW_USEDEFAULT), static_cast< ulong >(CW_USEDEFAULT),
                                      0, 0, 0, STARTF_USESHOWWINDOW, SW_HIDE, 0, 0, 0, 0, 0
                                    };
-        success = CreateProcess(0, const_cast< wchar_t* >(static_cast< const wchar_t* >(arguments.utf16())),
+        // PQR for MinGW-w64: Parameter #2 was const_cast< wchar_t* >(static_cast< const wchar_t* >(arguments.utf16())).
+        success = CreateProcess(0, (LPWSTR)arguments.utf16(),
                                 0, 0, FALSE, CREATE_UNICODE_ENVIRONMENT | CREATE_NEW_CONSOLE, 0,
                                 0,
                                 &startupInfo, &pinfo);
@@ -887,7 +888,7 @@ bool ExecuteOperation::performOperation()
     {
         Environment::instance().applyTo(&process); //apply non-persistent variables
         process.start(args.front(), args.mid(1));
-        
+
         QEventLoop loop;
         QObject::connect(&process, SIGNAL(finished(int, QProcess::ExitStatus)), &loop, SLOT(quit()));
         QObject::connect(&process, SIGNAL(readyRead()), this, SLOT(readProcessOutput()));
diff --git a/src/sdk/sdk.pro b/src/sdk/sdk.pro
index 7ca88ef..2cf25e9 100644
--- a/src/sdk/sdk.pro
+++ b/src/sdk/sdk.pro
@@ -1,11 +1,12 @@
 TEMPLATE = app
 DEPENDPATH += . ..
-INCLUDEPATH += . .. 
+INCLUDEPATH += . ..
 TARGET = installerbase
 
 include(../../installerfw.pri)
 
 LIBS += -linstaller
+win32:LIBS += -lmpr # PQR for MinGW-w64.
 QT += network script
 
 CONFIG -= app_bundle
diff --git a/tools/archivegen/archivegen.pro b/tools/archivegen/archivegen.pro
index ff9fdbd..30b885a 100644
--- a/tools/archivegen/archivegen.pro
+++ b/tools/archivegen/archivegen.pro
@@ -8,6 +8,7 @@ include(../../installerfw.pri)
 QT -= gui
 QT += script
 LIBS += -linstaller
+win32:LIBS += -lmpr # PQR for MinGW-w64.
 
 CONFIG += console
 CONFIG -= app_bundle
diff --git a/tools/binarycreator/binarycreator.pro b/tools/binarycreator/binarycreator.pro
index 706318e..f26579f 100644
--- a/tools/binarycreator/binarycreator.pro
+++ b/tools/binarycreator/binarycreator.pro
@@ -8,6 +8,7 @@ include(../../installerfw.pri)
 QT -= gui
 QT += script
 LIBS += -linstaller
+win32:LIBS += -lmpr # PQR for MinGW-w64.
 
 CONFIG += console
 CONFIG -= app_bundle
diff --git a/tools/repogen/repogen.pro b/tools/repogen/repogen.pro
index 5b6f0d0..6fd63b8 100644
--- a/tools/repogen/repogen.pro
+++ b/tools/repogen/repogen.pro
@@ -8,6 +8,7 @@ include(../../installerfw.pri)
 QT -= gui
 QT += script
 LIBS += -linstaller
+win32:LIBS += -lmpr # PQR for MinGW-w64.
 
 CONFIG += console
 CONFIG -= app_bundle
