Article directory
- win system
-
- QT's .pro file
- The win environment uses the jom compiler to manually generate the pro project
- source file writing
- Set system environment variables
- Compile .pro using the cmd command line
- The jom compiler compiles the Makefile
- Command batch processing using .bat scripts
- The completion of the above will generate the final debug version of the exe
- Linux system
----- QT learning summary, from the QT course learning of lecturer Xia Caojun
win system
QT's .pro file
Compile the pro file using the qmake tool to generate a Makefile, use jom to compile the Makefile in win, and use make to compile the Makefile in Linux.
The win environment uses the jom compiler to manually generate the pro project
source file writing
Notice:! Among them, only main.cpp is placed this time, and person.h and .cpp in the screenshot are only used to add to sources when viewing multiple files.
Use the console to view the output;
getchar prevents direct flashback;
Set system environment variables
qmake: in the bin directory of QT's vc; jom is in the bin directory of QT's tools;
Compile .pro using the cmd command line
The jom compiler compiles the Makefile
Command batch processing using .bat scripts
The bat script can process commands in batches, making it easy to call commands with one click;
The completion of the above will generate the final debug version of the exe
Linux system
Similar to the process of the win system; the command can refer to the .sh batch command script (the batch command processing script is bat in win, sh in Linux)
- Add environment variables ( add path; note, in Linux, colons are used to separate different environment paths, in win, semicolons are used; $PATH is separated to represent the current existing environment path)
- Compile .pro with qmake
- Use make instead of jom in win to compile Makefile
- Execute the generated executable
- Note: If you use the sh script to execute with one click, you need to add executable permissions