Use qmake to compile and run Qt project under linux

         Use the IDE tool of Qtcreator to click the corresponding generate button to generate the target file. Also use the qmake command to generate a Makefile, and run the Makefile to generate an executable file. qmake is a tool program that helps simplify the construction process of cross-platform project development. It is one of the tools attached to Qt. For details, see qmake_Baidu Encyclopedia (baidu.com) .

The steps for qmake to generate executable files are as follows:

1. Execute qmake under the .pro file to generate Makefile.

7756043471754108a10a1ecf10eb3a52.png

 

2. Execute make -j8 //Parallel compilation

5ecba446f1324286912cca8e6f42061d.png

Note: The above steps should be noted that if there is a problem with the compilation, you can make clean, delete the product generated by make, delete the Makefile and .qmake.stash files, and then recompile.

 3. Run the target program test1

 764e5b792b5d4319aa388888eab4c099.png

 

 The blog post introducing compiling projects through qmake can also refer to [qt creator] qmake generates makefile_wanxiu.'s blog-CSDN blog_qmake generates makefile

 

Guess you like

Origin blog.csdn.net/hanxiaoyong_/article/details/126963823