Executable won't run after windeployqt
-
I have a simple qt (mostly QML) app built in Win10-64 with Qt Creator. I tried using windeployqt as per directions I found online, and according to the output it found and copied all necessary files.
BUT...when I try to run myapp.exe from the directory windeployqt filled with DLL's, nothing happens. I'm running from the command prompt, and there are no errors/messages, just return back to the prompt.
I don't see any error in the system event viewer either.
What is going wrong?
-
@ocgltd said in Executable won't run after windeployqt:
After reading lots of posts on StackOverflow, I'm starting to suspect that I need to tell windeployqt about my QML files (even though they are all in a QRC and compiled into the exe).
I'm not sure why there is no error output to stdout/stderr but I'll report back on results
that sounds about right, the windeployqt tool needs to know where your source qml files are, so it can parse them and fetch everything they import from the QT directory the
--qmldir
argument followed by the path to your qml files(folder) (main.qml etc) -
After reading lots of posts on StackOverflow, I'm starting to suspect that I need to tell windeployqt about my QML files (even though they are all in a QRC and compiled into the exe).
I'm not sure why there is no error output to stdout/stderr but I'll report back on results
-
@ocgltd said in Executable won't run after windeployqt:
After reading lots of posts on StackOverflow, I'm starting to suspect that I need to tell windeployqt about my QML files (even though they are all in a QRC and compiled into the exe).
If your QML files are in a .qrc, then you don't neeed to tell windeployqt about them.[EDIT: See @J-Hilk's reply below]However, you might need to tell windeployqt to copy the built-in Qt QML files/plugins.
I'm not sure why there is no error output to stdout/stderr but I'll report back on results
Do you see anything in DebugView? https://docs.microsoft.com/en-us/sysinternals/downloads/debugview
-
@ocgltd said in Executable won't run after windeployqt:
After reading lots of posts on StackOverflow, I'm starting to suspect that I need to tell windeployqt about my QML files (even though they are all in a QRC and compiled into the exe).
I'm not sure why there is no error output to stdout/stderr but I'll report back on results
that sounds about right, the windeployqt tool needs to know where your source qml files are, so it can parse them and fetch everything they import from the QT directory the
--qmldir
argument followed by the path to your qml files(folder) (main.qml etc) -
OK solved. I needed to add the --qmldir option. So even though all of my QML files are in a QRC file, the windployqt program still needs to scan those file to find imports used by those files.
As well, I had to add the compiler runtime option.
Now it runs.
-
Hi,
windeployqt does not inspect the executable content, it's not a decompiler. That's why you have to use qmldir to point to your sources for it to do its work.