Important: Please read the Qt Code of Conduct -

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:

    Basically all that you need to do when compiling Qt is add -target xp to the configure command line.

    Thanks to Joerg for adding this feature!

    Edit: parameter -target xp

  • So -platform xp will work in the upcoming Qt 5.3? If so, excellent news, I have to support Windows XP.

    Note: even with this, you still cannot use VS2012 RTM for XP deployment, you have to update it, best one is "Update 4": But VS2013 works out of the box :-)

    (Also I have to change my "blog post about Qt and XP": )

  • Good point on VS2012 update.

    I confirmed this with 5.3.0 RC. Qt built with -target xp will work on XP, and so will all executables built with said qmake.

    edit: fixed parameter.

  • 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 )

  • Just noticed that I still need to define set CL=/D_USING_V110_SDK71_ for applications built with qmake.

  • I belive it's "-target xp" as an option to target Windows XP, not "-platform xp".
    ICU libraries should be recompiled too.

  • ab_it, you are right. Fixed in first post.

  • 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.

    Wrote a "blog post": how to set it.

  • [quote author="hskoglund" date="1401950279"]you can still, by a simple setting in Projects/Build Environment, deploy any Qt app to Windows XP.

    Wrote a "blog post": how to set it.

    Thanks a lot, works like a charm. Stupid me already looked at that blog of yours - just didn't realized it's good for 2013 aswell.

Log in to reply