I am trying to compile my code in Qt Creator on Windows, and it compiles and runs in Qt Creator. However, when I try to run the exe from outside Qt Creator, I get errors about missing dlls.
From what I've researched so far, there are two options:
- Find these missing DLLs and copy them into the same directory as the exe, and hope to god I copied the right versions.
- Use windeployqt to automate (1).
Now I don't want to be dealing with windeployqt via the command line - is there a way I can get Qt Creator to take care of that for me? So far, when I click on Deploy, it just builds the project, but doesn't seem to do anything else.
You can run
windeployqtwithQMAKE_POST_LINK. Just setDEST_DIRto where you want to deploy your application and call thewindeployqton that directory.Here is an example.
With this implementation, it will create a
binfolder in project folder, copies the target (.exe) to that directory and runswindeployqton it. You are free to choose another directory relative to your project directory or an absolute path.