- 
    Bug 
- 
    Resolution: Done
- 
     Not Evaluated Not Evaluated
- 
    5.8.0, 5.9.0, 5.9.1
- 
    None
- 
    Debian Stretch, Qt 5.9.1, MinGW 6.3.0
 
 {code:none}
 ./configure -prefix ${PREFIX_DIR} \
 -opensource -confirm-license \
 -pch \
 -nomake examples \
 -nomake tools \
 -nomake tests \
 -skip translations \
 -skip doc \
 -skip activeqt \
 -skip qtwebsockets \
 -skip qtscript \
 -skip qtconnectivity \
 -skip qtenginio \
 -skip qtsensors \
 -skip qtserialport \
 -skip qtlocation \
 -skip qtimageformats \
 -skip webchannel \
 -skip multimedia \
 -no-dbus \
 -no-icu \
 -no-qml-debug \
 -no-compile-examples \
 -qt-libjpeg \
 -qt-libpng \
 -qt-zlib \
 -qt-pcre \
 -static \
 -xplatform win32-g++ \
 -device-option CROSS_COMPILE=i686-w64-mingw32- \
 -release \
 -opengl desktop
 {code}Debian Stretch, Qt 5.9.1, MinGW 6.3.0 {code:none} ./configure -prefix ${PREFIX_DIR} \ -opensource -confirm-license \ -pch \ -nomake examples \ -nomake tools \ -nomake tests \ -skip translations \ -skip doc \ -skip activeqt \ -skip qtwebsockets \ -skip qtscript \ -skip qtconnectivity \ -skip qtenginio \ -skip qtsensors \ -skip qtserialport \ -skip qtlocation \ -skip qtimageformats \ -skip webchannel \ -skip multimedia \ -no-dbus \ -no-icu \ -no-qml-debug \ -no-compile-examples \ -qt-libjpeg \ -qt-libpng \ -qt-zlib \ -qt-pcre \ -static \ -xplatform win32-g++ \ -device-option CROSS_COMPILE=i686-w64-mingw32- \ -release \ -opengl desktop {code}
- 
        fe63ea126822fae40db90a06ab3be47700e85ec4 (qtwinextras/5.9, 3.7.2017, 5.9.2)
When cross-compiling Qt 5.9.1 with MinGW 6.3.0 (as packaged by Debian Stretch), I get a warning
qwinjumplist.cpp:44:66: warning: integer overflow in preprocessor expression # if defined(_WIN32_IE) && _WIN32_IE << 0x0700 // _WIN32_IE_IE70
and later an error
qwinjumplist.cpp: In static member function ‘static IShellItem2* QWinJumpListPrivate::toIShellItem(const QWinJumpListItem*)’:
qwinjumplist.cpp:400:106: error: ‘SHCreateItemFromParsingName’ was not declared in this scope
     SHCreateItemFromParsingName(buffer.data(), 0, qIID_IShellItem2, reinterpret_cast<void **>(&shellitem));
                                                                                                          ^
I suspect that the macro, the one from the warning above, has a bug – the original author probably meant to write _WIN32_IE < 0x0700 instead of _WIN32_IE << 0x0700.
Here is the relevant code portion from Qt sources
#ifdef Q_CC_MINGW // MinGW: Enable SHCreateItemFromParsingName() # if defined(_WIN32_IE) && _WIN32_IE << 0x0700 // _WIN32_IE_IE70 # undef _WIN32_IE # endif # ifndef _WIN32_IE # define _WIN32_IE 0x0700 # endif #endif // Q_CC_MINGW
My MinGW defines -DWINVER=0x600 -D_WIN32_WINNT=0x0600, which I assume indirectly triggers definition of _WIN32_IE 0x600 somewhere in Windows headers. In the macro above, WIN32_IE << 0x0700 is turned into 0x600 << 0x0700 which evaluates to false, so _WIN32_IE is never re-defined to be 0x0700, and SHCreateItemFromParsingName() is not made visible in Windows headers if _WIN32_IE < 0x0700 (Windows Vista API version), thus the compilation fails not being able to find SHCreateItemFromParsingName.
This bug was introduced in commit decbd7c63334e97ace549ffcb7d2f6fe5eeb5640 by Friedemann Kleint while fixing QTBUG-51673 over a year ago.