Compile Qt 5.3 for Windows XP with VS2012/2013 [SOLUTION!]

I've struggled with this ever since we moved to VS2012 ( and now VS2013 ). Getting binaries that work for Windows XP with qmake was a pain and required editing sources left and right. But a commit that dropped about a month ago has finally taken the pain away!

I ended up finding this commit because the mkspec for vs2013 has a new variable: QMAKE_SUBSYSTEM_SUFFIX, a quick search led me to the commit:

Nice! When using Qt 5.3, I see no reason not to include -platform xp in all projects (well maybe not if you're 100% positive it will not run on XP).
After all, the MinGW compiler uses /SUBSYSTEM:WINDOWS,4 (not 5.0x, i.e. compatible for Windows NT4) for all projects.

I agree, at least for 32 bit builds. My 64 bit builds I am building without the xp parameter. I believe that might only exclude XP 64, which is not very common at all. I've been doing that for a while and have not heard any complains from my users. ( so far :D )

I just started testing Qt and installed the precompiled Qt 5.3.0 for Windows 32-bit (VS 2013, OpenGL, 616 MB) installer. Seems to work very nice so I decided to get deeper into it but I couldn't deploy my app for XP.

Did I get this right? I need to build Qt myself instead of using the prebuild one if I want to support WindowsXP?

Hi, no it's not that bad, while it's correct that if (when using VS2012 and VS2013) you want to support XP "out of the box", you have to rebuild Qt; you can still, by a simple setting in Projects/Build Environment, deploy any Qt app to Windows XP.