- TSLIB source code compilation
Since QT relies on TSLIB, compile TSLIB before compiling QT source code.
Download tslib-1.15tar.bz2 from https://github.com/libts/tslib/releases/tag/1.15 to the Linux system and decompress it, enter the decompression directory, and create a new install directory:#cd tslib-1.15 #mkdir install
Confirm whether the cross compilation chain matches:
Get the full path of the install directory:
Start cross compilation:#./configure --prefix=/home/ronnie/work/ssd201/qt/tslib-1.15/install -host=arm-linux-gnueabihf
#make #make install
- QT source code compilation
- Download qt-everywhere-src-5.15.0.tar.xz from http://download.qt.io/archive/qt/5.15/5.15.0/single/ to the Linux system and unzip:
- Enter the decompression directory, and then create a new compilation script make.sh
#cd qt-everywhere-src-5.15.0 #touch make.sh
#vi make.sh
Start cross compilation:#./make.sh
After waiting for a period of time, the compilation is complete:
Set the qmake environment variable:#vi ~/.bashrc
export PATH=/home/ronnie/work/ssd201/qt/qt-everywhere-src-5.15.0/install/bin:$PATH#source ~/.bashrc
- Initialization screen
Before the QT application is executed, the screen needs to be initialized, otherwise it cannot be displayed normally. For screen initialization, please refer to logo.c of ftp://183.62.174.252/SSD20X/Demo_Release/MI_DEMO/JpegPlayer/.
- Download JpegPlayer.rar to the Linux system, and unzip it to the same level directory of the project:
- Enter the decompression directory and copy logo.c to disp_init.c:
- Modify disp_init.c to delete the code other than initialization:
- Copy the adjusted screen parameter header file to the JpegPlayer directory:
- Modify sstardisp.c to include the screen parameter header file:
- Modify makefile
- Compile, the disp_init executable file will be generated in the directory:
#make
- Verification
- Create a new project hello through QT Creator, and then copy it to the Linux system:
- In the hello directory, execute qmake -project to generate hello.pro:
- Edit hello.pro and make the following changes:
- Ensure that the cross-compilation chain environment configuration is correct:
- Compile the project
#qmake #ARCH=arm make
- After the compilation is completed, the hello executable file will be generated in the directory:
- Copy libts.so* to the /usr/lib directory of the board:
- Copy the font library to the /usr/lib/font directory, the font library can be obtained from sdk/verify/application/zk_full/res/font/:
- Add QT environment variables:
#vi /etc/profile
#source /etc/profile
- Copy disp_init and hello to the board, first run disp_init in the background, and then run hello:
#./disp_init & #./hello
The screen can be displayed normally, indicating that QT transplantation is successful.
文档更新时间: 2020-10-24 20:28 作者:admin