Details
-
Bug
-
Resolution: Done
-
P4: Low
-
None
-
4.8.6
-
None
-
Qt 4.8.6, Windows 7 SP-1, MSVC 2013 compiler, "v120_xp" toolset
-
2913f89cea4f9dd76988b854390526dd1fc35a99 (6.5.2014, 4.8.7)
Description
When trying to build Qt 4.8.6 with MSVC 2013 I noticed that it failed to build with the following error:
qeventdispatcher_win.cpp kernel\qeventdispatcher_win.cpp(515) : error C2065: 'QS_TOUCH' : undeclared identifier kernel\qeventdispatcher_win.cpp(515) : error C2065: 'QS_POINTER' : undeclared identifier
This seems to be a regression since there was no such problem in in Qt 4.8.5.
The problematic code is the following:
static inline UINT inputTimerMask() { UINT result = QS_TIMER | QS_INPUT | QS_RAWINPUT; // QTBUG 28513, QTBUG-29097, QTBUG-29435: QS_TOUCH, QS_POINTER became part of // QS_INPUT in Windows Kit 8. They should not be used when running on pre-Windows 8. #if defined(_MSC_VER) && _MSC_VER >= 1700 if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8) result &= ~(QS_TOUCH | QS_POINTER); #endif // _MSC_VER >= 1700 return result; }
The problem seems to be that the current code assumes “QS_TOUCH” and “QS_POINTER” are defined when a specific minimum compiler version is used, while in fact it depend on the version of the Windows SDK, not the compiler! In particular, VS2012 and VS2013 will fall back to an older SDK version when “Windows XP” support ("v120_xp" toolset) is enabled. So the assumption that an up-to-date compiler implies an up-to-date Windows SDK is not always correct…
(Now one might argue that we don’t need to care about Windows XP anymore. But my stats tell me that Windows XP won’t go away that fast. It’s currently at approx. 17% – more than Windows 8 and 8.1 combined)
The following workaround did the trick for me:
https://qt.gitorious.org/qt/mumble-developers-qt/commit/fa21fd9cfe5faf4494aa0b37892fa8651d9c72ed
--- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -510,7 +510,7 @@ UINT result = QS_TIMER | QS_INPUT | QS_RAWINPUT; // QTBUG 28513, QTBUG-29097, QTBUG-29435: QS_TOUCH, QS_POINTER became part of // QS_INPUT in Windows Kit 8. They should not be used when running on pre-Windows 8. -#if defined(_MSC_VER) && _MSC_VER >= 1700 +#if defined(_MSC_VER) && _MSC_VER >= 1700 && !defined(_USING_V110_SDK71_) if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8) result &= ~(QS_TOUCH | QS_POINTER); #endif // _MSC_VER >= 1700
Regards,
MuldeR
Attachments
For Gerrit Dashboard: QTBUG-38604 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
84564,1 | Use WINVER instead of _MSC_VER for version check in qeventdispatcher_win.cpp. | 4.8 | qt/qt | Status: MERGED | +2 | 0 |