I am writing a program for windows (xp, 7,8,10) using Qt.

Work PC - Win10x64, in QtCreator with Qt5.8, MinGW 5.3.0 32bit.

I am compiling a program in release mode, adding all the necessary Qt libraries to it. On my PC it starts up normally, everything works. On other PCs with Win10x64, everything is fine too.

Problems arise when I try to run on a PC with Win7x86. Sometimes various kinds of errors take off, basically "there is not enough such a library (and various system libraries)", Sometimes not. About XP, I generally keep quiet, it flies constantly.

Please tell me how to build the program so that it works on all platforms?

I have never come across this before, I thought once it works for me, then it works for everyone.

  • 2
    Yes, 64-bit programs do not work on a 32-bit OS. - Abyx
  • 2
    Specify which compiler compiled Qt? MinGW? MSVC? - Alexander
  • @Abyx, Then how do I compile the release? Do not reinstall the same windows - Miron Sosyak
  • one
    x86 you need to choose a compiler, Miron. - user1056837
  • 3
    64-86 has nothing to do with it, under a 32-bit OS, a 64-bit application would not start at all. It seems that you are collecting with some features specific to Win10 - appearing after Win7. At a minimum, I would start by saying that I would do everything with statically linked libraries, and when I compiled it somewhere (I am not familiar with MinGW, so I won’t say how) I indicated that the target OS is Windows7. To close and all sorts of functions of the dozens were not used. But, by the way, Qt should also be collected in the same way - otherwise these calls may sit in it ... - Harry

1 answer 1

The problems of a 64-bit application on a 32-bit x86 platform have nothing to do with it, under a 32-bit OS, a 64-bit application would not start at all .

It seems that you are building your program with some functions specific to Win10 - those that appeared after the release of Win7. At the same time, they are grouped with dynamic libraries, which are connected as you work, only at the moment when they are needed.

So at least I would start by assembling an application with statically linked libraries, and compiling somewhere (not familiar with MinGW, so I don’t say exactly how) indicated that the target OS is Windows7 so that no functions specific to later windows were not used.

By the way, Qt should also be collected in the same way, since such calls may appear in it ...

Here is a specific example, if you want - the GetSystemTimePreciseAsFileTime function requires at least Windows8. The program will easily compile with it, but it will not work in Windows7.

There is one more thing - I don’t know how it manifests itself in MinGW, I’m talking about Visual C ++ - when linking, the linker gets the /SUBSYSTEM parameter, which indicates which program will work with the minimum version. But this key simply does not allow to start the application, so the symptom is not yours, but nevertheless it is worth knowing about it.