Simple process of Qt program packaging under windows

        I still remember that when I was just working, I wanted the compiled exe file to run out of the environment shortly after I came into contact with qt. For example, writing a small software can make it run on other people's computers to satisfy a little vanity. It seemed to be quite troublesome at the time (maybe I still knew too little at the time). A colleague told me a way to find a static library similar to the QT version you installed on the Internet. The obtained static library files are compiled together, so that they can be run on any computer. The disadvantage is that there are limited versions of the static library available for download on the Internet. When your own QT version is different from it, you can't uninstall it. I was not happy with this approach at the time.

        Today, referring to the method of netizens, I personally tested a relatively simple method, which is feasible, and I will briefly record it for your reference.

1. Switch the qt project to the release version, compile, and copy the .exe file in the generated file separately and put it in a newly created folder.

Copy ShuraYard.exe into my newly created folder named exe (the name can be chosen at will);

2. Find the command corresponding to your qt version and open it, and execute the windeployqt command

Enter the absolute path of the cd /d target folder. After entering, enter the full name of the windeployqt target exe. After pressing Enter, the relevant conversion will be completed soon.

 

 At this point, copy this folder to another computer, and you can run the exe program directly (if it cannot run, it means that the compiler you chose is wrong), but the matter is not over yet, and the attached files are still a bit too much, which is not neat enough.

3. Use Enigma Virtual Box to package (turn all the above files into an executable program)

Official download address: Enigma Virtual Box

 

Add... The second step is to select the second item Add Folder Recursive, and the Process can be completed after the addition is completed.

Finally, the target packaged exe file will be generated under the output folder, and this single exe file can be copied to the computer of the small partner to run it at will.

 

 

 

Guess you like

Origin blog.csdn.net/DIANZI520SUA/article/details/130387113