How to solve the problem that the Qt release file cannot be executed

How to solve the problem that the Qt release file cannot be executed

1.Qt environment variable settings

If you have set it, please skip it directly. If you haven't come and go together:
First: Open the file installation directory: D:\QT\Tools\QtCreator\bin
demonstrates my own directory, you can adjust it yourself. Specifically, right-click the program icon, open the file location and copy the directory.
Then right-click this computer -> Properties -> Advanced Settings -> Environment Variables -> System Variables, select path and edit -> Copy the directory after creating.
Restart the computer to take effect (some people say that there is no need to restart...I just restarted it anyway).

2. Package release of qt release file

It’s said on the Internet to add .dll files one by one according to the warning. This is definitely more troublesome. For convenience, we can use the command to let it be added automatically. Specific steps:
warn that all paths here are mine. You should modify them as needed, but try not to build them on the C drive.
Create a folder in the D drive: myprojiect
opens the executable file of the release version: My path is D:\QTprojiect\NotePad\build-NotePad-Desktop_Qt_5_9_9_MinGW_32bit-Release\release
. Note here that the
release file is not the release file in debug The folder will appear after running in release mode
Insert picture description here

Then press win+R, enter cmd,
enter this folder through cd /d D:\myprojiect, press enter,
then enter windeployqt projiect.exe --qmldir D:\QT\5.9.9\mingw53_32\qml and press enter
to see The following scenarios:
Insert picture description here

This means that you are already ok and then go to the myproject folder and find that everything is complete, just compress it and send it to your classmates.

Guess you like

Origin blog.csdn.net/m0_50210478/article/details/108190069