The QT program developed under win10 runs incorrectly on win7
-
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... -
@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? -
@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. -
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 -
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." -
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. -
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...
-
@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.
-
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. -
Hi @JonB
My topic is the problem of running the developed application. Later, @hskoglund provided the modified Qt library and asked me to
build the development environment directly on win7 and develop application with QT creator. Therefore, the error later was the running error of Creator.
I'm sorry I didn't make it clear. Thank you again.