diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 8ecb41b9c2533d2ff33c6fc393c70fde4a6b635f..fd1ddc0b0d9f14b442de5847b038ffa20f499a82 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -48,7 +48,7 @@ CXXFLAGS_BARE = $(CFLAGS_BARE)
 CXXFLAGS = $(CFLAGS)
 
 LFLAGS	    =
-LIBS	    = ole32.lib advapi32.lib
+LIBS	    = ole32.lib advapi32.lib shell32.lib
 LINKQMAKE   = $(LINKER) $(LFLAGS) -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS)
 ADDCLEAN    = qmake.pdb qmake.ilk
 
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 8b67fc1962bff73dc67c72fda8982ccd86bdf562..db4612ae331e5845c688daae37c21d7e3128582b 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -78,6 +78,7 @@
 #ifdef Q_OS_WIN // for homedirpath reading from registry
 #  include <private/qsystemlibrary_p.h>
 #  include <qt_windows.h>
+#  include <shlobj.h>
 #endif
 
 #ifdef Q_OS_WINRT
@@ -1036,18 +1037,9 @@ static QString windowsConfigPath(int type)
 {
     QString result;
 
-#ifndef Q_OS_WINCE
-    QSystemLibrary library(QLatin1String("shell32"));
-#else
-    QSystemLibrary library(QLatin1String("coredll"));
-#endif // Q_OS_WINCE
-    typedef BOOL (WINAPI*GetSpecialFolderPath)(HWND, LPWSTR, int, BOOL);
-    GetSpecialFolderPath SHGetSpecialFolderPath = (GetSpecialFolderPath)library.resolve("SHGetSpecialFolderPathW");
-    if (SHGetSpecialFolderPath) {
-        wchar_t path[MAX_PATH];
-        SHGetSpecialFolderPath(0, path, type, false);
+    wchar_t path[MAX_PATH];
+    if (SHGetSpecialFolderPath(0, path, type, false))
         result = QString::fromWCharArray(path);
-    }
 
     if (result.isEmpty()) {
         switch (type) {
diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp
index 200cf4c1b5ed53789f3990e6fff3fce7ef2d8aff..a0344a02063a3f5064aca08f9ed892fc625c3c25 100644
--- a/src/corelib/io/qstandardpaths_win.cpp
+++ b/src/corelib/io/qstandardpaths_win.cpp
@@ -68,21 +68,6 @@
 
 QT_BEGIN_NAMESPACE
 
-typedef BOOL (WINAPI*GetSpecialFolderPath)(HWND, LPWSTR, int, BOOL);
-static GetSpecialFolderPath resolveGetSpecialFolderPath()
-{
-    static GetSpecialFolderPath gsfp = 0;
-    if (!gsfp) {
-#ifndef Q_OS_WINCE
-        QSystemLibrary library(QLatin1String("shell32"));
-#else
-        QSystemLibrary library(QLatin1String("coredll"));
-#endif // Q_OS_WINCE
-        gsfp = (GetSpecialFolderPath)library.resolve("SHGetSpecialFolderPathW");
-    }
-    return gsfp;
-}
-
 static QString convertCharArray(const wchar_t *path)
 {
     return QDir::fromNativeSeparators(QString::fromWCharArray(path));
@@ -92,10 +77,6 @@ QString QStandardPaths::writableLocation(StandardLocation type)
 {
     QString result;
 
-    static GetSpecialFolderPath SHGetSpecialFolderPath = resolveGetSpecialFolderPath();
-    if (!SHGetSpecialFolderPath)
-        return QString();
-
     wchar_t path[MAX_PATH];
 
     switch (type) {
@@ -185,8 +166,7 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
     // type-specific handling goes here
 
 #ifndef Q_OS_WINCE
-    static GetSpecialFolderPath SHGetSpecialFolderPath = resolveGetSpecialFolderPath();
-    if (SHGetSpecialFolderPath) {
+    {
         wchar_t path[MAX_PATH];
         switch (type) {
         case ConfigLocation: // same as DataLocation, on Windows (oversight, but too late to fix it)
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index 967f45d5df33ef22e22ba83cda339aca5a60efc3..8eb8401543a3621f8da94fa6534375445a2ddf7a 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -148,7 +148,7 @@ macx {
 if(contains(QT_CONFIG, zlib)|cross_compile):include(../../3rdparty/zlib.pri)
 else:include(../../3rdparty/zlib_dependency.pri)
 
-win32:LIBS += -luser32 -lole32 -ladvapi32
+win32:LIBS += -luser32 -lole32 -ladvapi32 -lshell32
 
 lib.CONFIG = dummy_install
 INSTALLS += lib
diff --git a/tools/configure/Makefile.win32 b/tools/configure/Makefile.win32
index ff38ddcc76e89340995eff319969b9f3e18fe82b..2ec99d30b02a23f086b67bafaf693b3fd2edb96a 100644
--- a/tools/configure/Makefile.win32
+++ b/tools/configure/Makefile.win32
@@ -9,7 +9,7 @@ CXXFLAGS_BARE = -nologo -Zm200 -Zc:wchar_t -MT -W3 -GR -EHsc -w34100 -w34189 $(E
 CXXFLAGS      = -FIconfigure_pch.h -Yuconfigure_pch.h -Fp$(PCH) -MP $(CXXFLAGS_BARE)
 LINK          = link
 LFLAGS        = /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST /MANIFESTFILE:"configure.intermediate.manifest"
-LIBS          = ole32.lib advapi32.lib
+LIBS          = ole32.lib advapi32.lib shell32.lib
 
 TARGET        = ..\..\configure.exe