33-Linux QT application compilation environment construction
Last updated
Last updated
qmake tool
1.View current Linux architecture uname -m
2.install dependencies
It is recommended to use qt5.12.2 qtcreator 4.11.1
choose the version you need
Select single
Select tar.xz
Unzip it after downloading in the opt folder
After the decompression is complete, enter the folder and create auto.sh script file.
The script is to execute./configure -prefix /opt/Qt/ \ Qt installation path
opensource-confirm-license \ installation version, community edition or commercial edition -nomake examples \ Do not compile installation examples -nomake tests \ Does not compile installation tests -release \ release Compile -skip qt3d \ skips compiling modules -skip qtcharts \ skips compiling modules -skip qtandroidextras \ skips compiling modules -skip qtlocation \ skips the compilation module, which is error-prone -skip qtmultimedia \ skips the compilation module -skip qtsensors \ Skip compiling modules -skip qtserialbus \ skips compiling modules -skip qtserialport \ skips compiling modules -skip qtwayland \ skips compiling modules -skip qtwebengine \ skips the compilation module, which is error-prone
qtlocation qtwebengine, if you do not specifically need these two modules, it is recommended not to compile These commands are described in the unzipped README After the execution, improve the system as prompted. Most of the errors are due to incomplete installation Carry out
Long time, 4-12 hours based on board function
Execute after completion
This command installs the program in/opt/Qt/. Modify environment variables after successful installation:
final executionqmake -v
To install qtcreator, you must first install Qt and compile qtcreator with Qt. If there is an error in compiling Qt, the compilation at this location will also error. If there are uncompiled modules or undependent modules when Qt is compiled, the qt compilation will not be affected, but the qtcreator will be affected. I tried adding -no-opengl, and there is no error in compiling qt. You can install it, but the qtcreator will fail.
Qtcreator should preferably correspond to the Qt version Qtcreator source code
Unzip after download is complete Here, the above tutorial is defaulted to after completion: Enter the decompression path and execute
Wait for the MakeFile file to be generated after completion. Then execute
After the compilation is completed, execute
After execution, open the bin folder and there will be qtcreator and qtcreator.sh Execute./qtcreator.sh & This way qtcreator will run in the background. Finally, you can configure qtcreator. Tools - > Options - > Kits Kits Select gcc as the compilation toolchain corresponding to the board. Generally, qtcreator is equipped with the gcc tool version by default, and select the cross-compilation tool corresponding to uname -r. It is best to use the cross-compilation tool with the same version number in the SDK.