Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. The QT program developed under win10 runs incorrectly on win7
Forum Updated to NodeBB v4.3 + New Features

The QT program developed under win10 runs incorrectly on win7

Scheduled Pinned Locked Moved Unsolved Qt 6
26 Posts 3 Posters 7.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • hskoglundH Offline
    hskoglundH Offline
    hskoglund
    wrote on last edited by
    #3

    Hi, as @JonB says, officially Qt6 does not work on Windows7.

    To make it work, 2 choices:

    1. Bend Windows7 to your will.
    2. Bend Qt6 to your will.

    I can assure you that choice 1 is enormously harder than choice 2 :-)

    I had more or less the same problem as you, I wanted to use Qt 6 on Windows 7. So I downloaded the source for Qt 6.2.2, edited it and rebuilt it with MSVC 2019 to work on Windows 7. Turns out only 3 .dlls needed to change, if you want to try you can download these patched versions, for more see https://forum.qt.io/topic/133002/qt-creator-6-0-1-and-qt-6-2-2-running-on-windows-7

    The patches I made included a fix for that dreaded "missing CreateDXGIFactory2 function" error: the code in Qt5 checks if it's running on Windows 10 or later, if it's not it uses CreateDXGIFactory1 instead (which works fine on Windows 7). In Qt6 this check is removed and it assumes it always runs on Windows 10 or 11.
    In total there were say 5 similar patches needed, mostly solved by copying back the code from Qt5 into Qt6. I will probably patch the upcoming Qt 6.2.3 in the same way, but this is an uphill battle, perhaps in Qt 6.4 or 6.5 there will be some new functions that requires Windows 10, we'll see...

    Anyway, these cleanups are understandable, it reduces code bloat and runtime overhead. On the other hand, consider:
    You can install a new Firefox on Windows XP (and Windows 7).
    The new Visual Studio 2022 installs and works fine on Windows 7.
    However, Microsoft and Mozilla are bigger companies with more resources.

    1 Reply Last reply
    4
    • B Offline
      B Offline
      bergerac
      wrote on last edited by
      #4
         Thanks @JonB and @hskoglund.
         @hskoglund , I followed your advice and downloaded the QT(6.2.1) installation package from the QT official website, but an error which said "Error during installation process (qt.qt6.621.win64_msvc2019_64): Running "E:\Qt\6.2.1\msvc2019_64\bin\qmake.exe" resulted in a crash." was reported on win7. Have you ever encountered this problem?Thank you again for your reply.
      
      1 Reply Last reply
      0
      • hskoglundH Offline
        hskoglundH Offline
        hskoglund
        wrote on last edited by
        #5

        Yes, see my older post this error is to be expected since the MaintenanceTool tries to launch qmake for an unpatched 6.2.2 on your Windows 7.
        Just click "Ignore" (have to do it two times), then 6.2.2 should be installed anway. Then you can try downloading my zip and replacing Qt6Core.dll, Qt6Gui.dll and qwindows.dll...

        1 Reply Last reply
        1
        • B Offline
          B Offline
          bergerac
          wrote on last edited by
          #6

          @hskoglund, I replaced the three libraries according to the steps by
          https://forum.qt.io/topic/133002/qt-creator-6-0-1-and-qt-6-2-2-running-on-windows-7, and then ran QT creator ,
          but there was an error “This application failed to start because no Qt platform plugin could be initialized.
          Reinstalling the application may fix this problem.Available platforms plugins are:direct2d,minimal,offscreen,windows.”
          Have you ever encountered this error?

          JonBJ 1 Reply Last reply
          0
          • B bergerac

            @hskoglund, I replaced the three libraries according to the steps by
            https://forum.qt.io/topic/133002/qt-creator-6-0-1-and-qt-6-2-2-running-on-windows-7, and then ran QT creator ,
            but there was an error “This application failed to start because no Qt platform plugin could be initialized.
            Reinstalling the application may fix this problem.Available platforms plugins are:direct2d,minimal,offscreen,windows.”
            Have you ever encountered this error?

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #7

            @bergerac
            While you wait for a specific solution from @hskoglund .

            Whenever you get "no Qt platform plugin could be initialized", to diagnose set environment variable QT_DEBUG_PLUGINS=1 in a shell/terminal and then run your application. You should get a stream of diagnostic output. Look right near the end for whatever the cause of your final problem is.

            1 Reply Last reply
            1
            • hskoglundH Offline
              hskoglundH Offline
              hskoglund
              wrote on last edited by
              #8

              Hi @bergerac most likely you successfully replaced Qt6Core.dll and Qt6Gui.dll but not qwindows.dll.
              If you look in your C:\Qt\Tools\QtCreator\bin\plugins\platforms folder, the original qwindows.dll is from November 23, 2021 with a size of 780568 bytes.
              My patched version is from December 21. 2021 with a size of 763904 bytes.

              If you have the one from November that could explain the error "The application failed..."
              Otherwise you can try following the advice from @JonB

              1 Reply Last reply
              1
              • B Offline
                B Offline
                bergerac
                wrote on last edited by
                #9

                Hi @JonB @hskoglund
                I checked the qwindows.dll again and confirmed that it had been replaced.
                Then i use @JonB method to run QT creator.exe by cmd, but did not get any output report.Did I miss something?

                1 Reply Last reply
                0
                • hskoglundH Offline
                  hskoglundH Offline
                  hskoglund
                  wrote on last edited by
                  #10

                  To see the output you need to start DbgView

                  JonBJ 1 Reply Last reply
                  1
                  • hskoglundH hskoglund

                    To see the output you need to start DbgView

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #11

                    @hskoglund
                    Ah, I'm not a Windows Qt user. So it doesn't just output to stdout/err under Windows if run from a Command prompt?

                    hskoglundH 1 Reply Last reply
                    0
                    • JonBJ JonB

                      @hskoglund
                      Ah, I'm not a Windows Qt user. So it doesn't just output to stdout/err under Windows if run from a Command prompt?

                      hskoglundH Offline
                      hskoglundH Offline
                      hskoglund
                      wrote on last edited by hskoglund
                      #12

                      @JonB No that would be too easy, but DbgView to the rescue.

                      JonBJ 1 Reply Last reply
                      1
                      • hskoglundH hskoglund

                        @JonB No that would be too easy, but DbgView to the rescue.

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by JonB
                        #13

                        @hskoglund
                        :) When I am advising people of this, do they have to download that DbgView, will it be there if they have MSVC or MinGW only?

                        hskoglundH 1 Reply Last reply
                        0
                        • B Offline
                          B Offline
                          bergerac
                          wrote on last edited by
                          #14

                          Hi @hskoglund @JonB
                          DbgView.exe shows the information
                          "[28200] qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found.
                          [28200] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                          [28200] Available platform plugins are: direct2d, minimal, offscreen, windows."

                          JonBJ 1 Reply Last reply
                          0
                          • JonBJ JonB

                            @hskoglund
                            :) When I am advising people of this, do they have to download that DbgView, will it be there if they have MSVC or MinGW only?

                            hskoglundH Offline
                            hskoglundH Offline
                            hskoglund
                            wrote on last edited by
                            #15

                            @JonB Again, that would be too easy. One of the first things I do a new Windows PC is to download the complete SysInternals suite.

                            1 Reply Last reply
                            0
                            • hskoglundH Offline
                              hskoglundH Offline
                              hskoglund
                              wrote on last edited by
                              #16

                              @bergerac Please include the text before "...[28200] qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found.""

                              1 Reply Last reply
                              0
                              • B bergerac

                                Hi @hskoglund @JonB
                                DbgView.exe shows the information
                                "[28200] qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found.
                                [28200] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                                [28200] Available platform plugins are: direct2d, minimal, offscreen, windows."

                                JonBJ Offline
                                JonBJ Offline
                                JonB
                                wrote on last edited by
                                #17

                                @bergerac
                                What did you do for

                                to diagnose set environment variable QT_DEBUG_PLUGINS=1 in a shell/terminal and then run your application.

                                because your output looks just like it was?

                                1 Reply Last reply
                                0
                                • B Offline
                                  B Offline
                                  bergerac
                                  wrote on last edited by
                                  #18

                                  Hi @hskoglund @JonB
                                  @hskoglund There was nothing else before that information.
                                  @JonB I open cmd, enter "set qt_debug_plugins = 1", and then locate to the installation directory to run QT Creator.exe.

                                  JonBJ 1 Reply Last reply
                                  0
                                  • hskoglundH Offline
                                    hskoglundH Offline
                                    hskoglund
                                    wrote on last edited by
                                    #19

                                    Hi, the output should be a couple of thousand lines, the first one should be:

                                    1  0.00000  [28200] QFactoryLoader::QFactoryLoader() checking directory path "C:/Qt/Tools/QtCreator/bin/plugins/platforms" ...
                                    

                                    don't need all thousands of lines, just say the 40 at the end...

                                    1 Reply Last reply
                                    0
                                    • B bergerac

                                      Hi @hskoglund @JonB
                                      @hskoglund There was nothing else before that information.
                                      @JonB I open cmd, enter "set qt_debug_plugins = 1", and then locate to the installation directory to run QT Creator.exe.

                                      JonBJ Offline
                                      JonBJ Offline
                                      JonB
                                      wrote on last edited by JonB
                                      #20

                                      @bergerac
                                      There ought be preceding output.

                                      Try SET QT_DEBUG_PLUGINS=1, just in case capitals matter, though I suspect not under Windows, but don't know.

                                      locate to the installation directory to run QT Creator.exe.

                                      That is not what I said. I said run the executable, not Creator. It is not apparent to me the variable will necessarily be passed to the application when run from there. If you do it that way you should look inside Creator where you see the "runtime environment variables" set up. Which is why running the program directly from the Command prompt is simpler.

                                      1 Reply Last reply
                                      0
                                      • B Offline
                                        B Offline
                                        bergerac
                                        wrote on last edited by
                                        #21

                                        Hi @JonB @hskoglund
                                        I run QT creator.exe directly , and then can see the debugging information
                                        "[28668] QFactoryLoader::QFactoryLoader() checking directory path "E:/Qt/Tools/QtCreator/bin/platforms" ...
                                        [28668] Cannot load library E:\Qt\Tools\QtCreator\bin\plugins\platforms\qwindows--.dll: The specified program could not be found.
                                        [28668] QLibraryPrivate::loadPlugin failed on "E:/Qt/Tools/QtCreator/bin/plugins/platforms/qwindows--.dll" : "Cannot load library E:\Qt\Tools\QtCreator\bin\plugins\platforms\qwindows--.dll: The specified program could not be found."
                                        I renamed the old library as qwindows--.dll and put the new library in.Debugging information indicates that QT creator is still looking for old library when it runs.

                                        JonBJ 1 Reply Last reply
                                        0
                                        • B bergerac

                                          Hi @JonB @hskoglund
                                          I run QT creator.exe directly , and then can see the debugging information
                                          "[28668] QFactoryLoader::QFactoryLoader() checking directory path "E:/Qt/Tools/QtCreator/bin/platforms" ...
                                          [28668] Cannot load library E:\Qt\Tools\QtCreator\bin\plugins\platforms\qwindows--.dll: The specified program could not be found.
                                          [28668] QLibraryPrivate::loadPlugin failed on "E:/Qt/Tools/QtCreator/bin/plugins/platforms/qwindows--.dll" : "Cannot load library E:\Qt\Tools\QtCreator\bin\plugins\platforms\qwindows--.dll: The specified program could not be found."
                                          I renamed the old library as qwindows--.dll and put the new library in.Debugging information indicates that QT creator is still looking for old library when it runs.

                                          JonBJ Offline
                                          JonBJ Offline
                                          JonB
                                          wrote on last edited by
                                          #22

                                          @bergerac
                                          Is you problem you reported earlier when you run Creator or when you run your application?
                                          I think I had misunderstood, I thought it was your program, now I think it is Creator you cannot run, but it is not clear.

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved