Solved deployed via windeployqt wont run but stays in background (task manager)
-
Dear all,
I have set the build the project as release under MSVC2017 32bit,
the folder with release was created, exe file inside also created.
While the released project was running via QT Creator, I have run following code:windeployqt c:\QML\Projects\build-TeamBonus-Desktop_Qt_5_12_0_MSVC2017_32bit-Release\release\TeamBonus.exe
from this path:
c:\Qt\5.13.0\msvc2017\bin
there was no error there at all, all dependencies were copied into the folder, so I have tested it by closing QT and runing the exe file, but nothing happend (no error, but the app stayed in task manager in background).
somewhere on different guide:
https://github.com/daviddrell/visualsc/wiki/How-to-Deploy-a-Qt-5-Application-for-Windows#4-missing-qt-dll-dependency
I did read that for some reason Qt5OpenGL.dll is not copied, so i tried to copy it myself and the issue was not solved... Later I copied ALL files from Qt\5.13.0\msvc2017\bin to release folder (just to be sure there is realy no dll missing in release directory), but still no luck...There is one thing, however I think is not related.
When I start QT Creator and open the project (even before I hit RUN Icon), i have this error:2019-04-30T17:52:48 Clang Code Model: Error: The clangbackend executable "C:\Qt\Tools\QtCreator\bin\clangbackend.exe" could not be started (timeout after 10000ms). Cannot open C:/QML/Projects/build-TeamBonus-Desktop_Qt_5_12_0_MSVC2017_32bit-Release/qml_qmlcache.qrc for writing. Cannot open C:/QML/Projects/build-TeamBonus-Desktop_Qt_5_12_0_MSVC2017_32bit-Release/qml_qmlcache.qrc for writing.
What else I can try?
-
- regarding the error try deleting the whole build folder, rerun qmake and build again
- check the deployed exe with DependencyWalker to make sure if all dependencies are met
- it seems you are also using QML in your application. This means you also need to deploy the qml files along with windeployqt. For that pass the "--qmldir <QTDIR>\qml" parameter to the windeployqt call
QML errors (which prevent the GUI to show) will be printed to the console, which is not present of course. The process is still running, because those are "just" runtime errors in the QML engine.
-
- regarding the error try deleting the whole build folder, rerun qmake and build again
- did not help, I have tried this several times
- check the deployed exe with DependencyWalker to make sure if all dependencies are met
- i will do this as a next step
- it seems you are also using QML in your application. This means you also need to deploy the qml files along with windeployqt. For that pass the "--qmldir <QTDIR>\qml" parameter to the windeployqt call
- I have tried this in 2 ways, one to go use <QTDIR> to my project so it will load only required dlls, and the second way as found online good to try is to use <QTDIR> to my c:\Qt\5.13.0\msvc2017\qml so I can be sure ALL dlls will be load... however no luck :/
QML errors (which prevent the GUI to show) will be printed to the console, which is not present of course. The process is still running, because those are "just" runtime errors in the QML engine.
- any way to print it out somehow?
-
@shokarta said in deployed via windeployqt wont run but stays in background (task manager):
I have tried this in 2 ways, one to go use <QTDIR> to my project so it will load only required dlls, and the second way as found online good to try is to use <QTDIR> to my c:\Qt\5.13.0\msvc2017\qml so I can be sure ALL dlls will be load... however no luck :/
did you try the way i said? With the
--qmldir
parameter?!any way to print it out somehow?
You could implement a custom messagehanlder and write (append) to a file.
-
yes, I have tried these two ways (non of them worked):
- windeployqt --release --qmldir c:\QML\Projects\TeamBonus c:\QML\Projects\build-TeamBonus-Desktop_Qt_5_12_0_MSVC2017_32bit-Release\release\TeamBonus.exe
- windeployqt --release --qmldir c:\Qt\5.13.0\msvc2017\qml c:\QML\Projects\build-TeamBonus-Desktop_Qt_5_12_0_MSVC2017_32bit-Release\release\TeamBonus.exe
Well, anyway I have tried to switch the compiler to MinGW 32b and now it seems to work quite nice...
Still wondering why MSVC doesnt -
Hi,
--qmldir
expects the path to your project's qml files. -
yes, which is the first option:
- windeployqt --release --qmldir c:\QML\Projects\TeamBonus c:\QML\Projects\build-TeamBonus-Desktop_Qt_5_12_0_MSVC2017_32bit-Release\release\TeamBonus.exe
-
Sorry, I misread your lines.
Are your qml files directly in TeamBonus ?
-
yes,
as said above, it works on MinGW compiler, however MSVC does not :(
-
I would check with 5.12.3 since it just got released to see if it was fixed there.