diff --git a/src/tools/qtcbuildhelper/main.cpp b/src/tools/qtcbuildhelper/main.cpp
index be5b85a0b9bf07b00f2ecbe3b116f5e1c9a06957..b7e29fd4ba4cfd81946f9df212fba5b76fb134cb 100644
--- a/src/tools/qtcbuildhelper/main.cpp
+++ b/src/tools/qtcbuildhelper/main.cpp
@@ -95,8 +95,11 @@ int main(int argc, char **)
             return 1;
     if (!findFirst(strCommandLine, strCommandLineLength, pos, L" \t", pos))
         return 1;
+#ifdef Q_CC_MSVC
     wmemmove_s(strCommandLine, strCommandLineLength, strCommandLine + pos + 1, strCommandLineLength - pos);
-
+#else
+    wmemmove(strCommandLine, strCommandLine + pos + 1, strCommandLineLength - pos);
+#endif
     bool bSuccess = startProcess(strCommandLine);
     free(strCommandLine);
 
@@ -151,7 +154,7 @@ BOOL WINAPI ctrlHandler(DWORD /*dwCtrlType*/)
     return TRUE;
 }
 
-DWORD WINAPI processWatcherThread(__in LPVOID lpParameter)
+DWORD WINAPI processWatcherThread(LPVOID lpParameter)
 {
     HANDLE hProcess = reinterpret_cast<HANDLE>(lpParameter);
     WaitForSingleObject(hProcess, INFINITE);
diff --git a/src/tools/qtcbuildhelper/qtcbuildhelper.pro b/src/tools/qtcbuildhelper/qtcbuildhelper.pro
index b2db7fa02588373b969d47e06ae02aca97e3e421..6fa231c011218703bf66bf3d58d54aa9bd320a18 100644
--- a/src/tools/qtcbuildhelper/qtcbuildhelper.pro
+++ b/src/tools/qtcbuildhelper/qtcbuildhelper.pro
@@ -10,5 +10,5 @@ QT        -= qt core gui
 CONFIG    += console warn_on
 
 SOURCES   += main.cpp
-LIBS      += user32.lib shell32.lib
+LIBS      += -luser32 -lshell32