It is necessary to compile the application under win32. I tried to change the compiler settings ( qmake -set QMAKE_SPEC win32-g++ ), but it does not work)) Visual has already been configured for win32, but Qt refuses. Maybe there are more ways (a simple substitution of the config has already been done, but in Qt Creator in the management of kits I changed the Qt mkspec, but it was overwritten)?

PS :: Everything is compiled, but refuses to run on xp under the pretext of "not win32"

  • Describe in more detail. What writes in the logs when trying to compile? - ragmon
  • So that's just the point, everything compiles normally, and virtual xp swears "not a win32 application" - MrBin
  • check in the project build settings (in the left pane, the computer icon if memory does not change) which compiler you have selected (there is probably 64 bit specified), compilers are self-detected in Qt settings or added manually. and then when you create a new project, you just need to specify it, so what to cut off everything else you need to remove all inappropriate compilers except the one you need (from the project assembly). Here is a bit of a useful stackoverflow.com/questions/36125236/… - perfect
  • All I have long checked. - MrBin

1 answer 1

The problem is that by default it compiles with vc140 and not with vc140_xp. Current Qt versions can build xp with support, but I did this:

  • In the required qmake.conf I added the necessary edits so that the correct makefile is generated. For example, for the linker, you must specify the correct version. qtbase / mkspecs / win32-msvc2012 / qmake.conf: QMAKE_LFLAGS_CONSOLE = / SUBSYSTEM: CONSOLE \ ", 5.01 \" QMAKE_LFLAGS_WINDOWS = / SUBSYSTEM: WINDOWS \ ", 5.01 \"
  • in the project in pch.h or in pro did the _WIN32_WINNT defile on xp, like this:

    #define _WIN32_WINNT 0x0502 (for example, it will not inline calls to InitCriticalSectionEx, which only appeared in whist, instead of InitCriticalSection).

Well, if depends shows that the problem is already with qt's libraries, then qt itself needs to be re-created after that (I usually first set up qmakespec rules and then already collected qt myself.

Well, if you need to build a one-time project, you can generate vcxproj (qmake -tp vc) open the project in the studio, and replace the toolset from vc140 with vc140_xp. Then it should work too.

  • It seems to have already changed the toolset to xp, but I will check it again. - MrBin
  • Unfortunately did not help (Disposable assembly). And about the longer version: I tried it earlier - MrBin
  • Make sure that in the settings of the vcxproj project for the exe-shnik in the Linker-> System settings, the Mimimum Required Version setting is in something like 5.01. - Andrey
  • If there is already 5.01 there, then the next step will be to collect the output of the command: dumpbin / headers <your_application.exe>. It will be interested in the values ​​of "operating system version", "subsystem version" and others. If there will be 6.00, then something was done wrong, you need to look at the project settings again. Well, if dumpbin shows 5.01 everywhere, then it will be necessary to look at the dependencies depends, or even run from under it. - Andrey
  • No, there is version 5.02, and in exe everything is at 6.00. After all the changes, it is still 6.00. Magic Qt - MrBin