Kickpi-Book
  • KICKPI Document
  • K5/K5C(A133)
    • A133中文文档
      • 01-主板介绍
        • 01-KICKPI-K5硬件介绍
        • 02-KICKPI-K5C硬件介绍
      • 02-入门必读
        • 01-网盘目录说明
        • 02-快速使用
        • 03-功能测试
        • 04-扩展引脚
      • 03-镜像烧录
        • 01-获取镜像文件
        • 02-SD卡烧录
        • 02-USB线烧录
      • 04-SDK编译
        • 01-编译环境搭建
        • 02-LINUX_SDK源码编译
        • 03-ANDROID_SDK源码编译
      • 05-外设驱动
        • LCD功能调试
        • LRADC按键配置
      • 06-ANDROID系统定制
        • 01-Android常用系统定制
      • 07-LINUX系统定制
        • 02-Linux常用系统定制
      • 08-进阶
        • K5C主板供电
        • 安卓休眠唤醒
        • 13-硬件工厂测试
    • en
      • 01-Development_board_Introduction
        • 01-KICKPI-K5_Hardware_Introduction
        • 02-KICKPI-K5C_Hardware_Introduction
      • 02-Getting_Started_Guide
        • 01-KICKPI_Cloud_Storage_Introduction
        • 02-Quick_Start_Guide
        • 03-Functional_Testing
        • 04-Expansion_Pins_Testing
      • 03-Image_Flashing_Guide
        • 01-How_to_Get_Image_File
        • 02-SD Card Burning
        • 03-USB_Cable_Flashing
      • 04-SDK_Compilation_Guide
        • 01-Compilation_Environment_Setup
        • 02-Linux_SDK_Compilation
        • 03-Android_SDK_Compilation
      • 06-Android_System_Customization
        • 01-Android_Common_System_Customization
      • 07-Linux_System_Customization
        • ADB_Tutorial
  • K2B/K2C(H618)
    • en
      • 01-Development_board_Introduction
        • 01-KICKPI-K2B_Hardware_Introduction
        • 02-KICKPI-K2B_Hardware_Introduction
      • 02-Getting_Started_Guide
        • 01-KICKPI_Cloud_Storage_Introduction
        • 02-Quick_Start_Guide
        • 03-Functional_Testing
        • 04-Expansion_Pins_Testing
      • 03-Image_Flashing_Guide
        • 01-SD_Card_Flashing
        • 02-USB_Cable_Flashing
      • 04-SDK_Compilation_Guide
        • 01-Compilation_Environment_Setup
        • 02-Linux_SDK_Compilation
        • 03-Android_SDK_Compilation
      • 05-Drivers_Development
        • RTC
      • 06-Android_System_Customization
        • 01-Android_Common_System_Customization
      • 07-Linux_System_Customization
        • 01-Linux_Common_System_Customization
      • 08-Advanced_Topics
        • Hardware_Factory_Testing
        • Keybox
    • zh
      • 01-主板介绍
        • 01-KICKPI-K2B硬件介绍
        • 02-KICKPI-K2C硬件介绍
      • 02-入门必读
        • 01-网盘目录说明
        • 02-快速使用
        • 03-功能测试
        • 04-扩展引脚
      • 03-镜像烧录
        • 01-SD卡烧录
        • 02-USB线烧录
      • 04-SDK编译
        • 01-编译环境搭建
        • 02-LINUX_SDK源码编译
        • 2. Android SDK编译
      • 05-外设驱动
        • RTC
      • 06-Android系统定制
        • Android常用系统定制
      • 07-Linux系统定制
        • 01-Linux常用系统定制
        • 02-Linux_QT开发环境搭建
      • 08-进阶
        • Keybox
        • Secure Boot
        • Windows_QT开发环境搭建
        • 扩展引脚功能定制
        • 硬件工厂测试
  • K1/K1B/K3/K8(RK356x-RK3588)
    • en
      • 01-Development_board_Introduction
        • 01-RK_Chip_Comparison_Introduction
        • 02-KICKPI-K1_Hardware_Introduction
        • 03-KICKPI-K1B_Hardware_Introduction
        • 04-KICKPI-K3_Hardware_Introduction
        • 05-KICKPI-K8_Hardware_Introduction
      • 02-Getting_Started_Guide
        • 01-Cloud_Storage_Directory_Description
        • 02-K1-Quick_Start_Guide
        • 02-K1B-Quick_Start_Guide
        • 02-K3-Quick_Start_Guide
        • 02-K8-Quick_Start_Guide
        • 03-Functional_Testing
        • 04-Expansion_Pins
      • 03-Image_Flashing_Guide
        • 01-USB_Cable_Flashing
      • 04-SDK_Compilation_Guide
        • 01-Compilation_Environment_Setup
        • 02-LINUX_SDK_Compilation
        • 03-ANDROID_SDK_Compilation
      • 05-Drivers_Development
        • GPIO
        • Kernel
        • LCD
        • PWM
        • RTC
      • 06-Android_System_Customization
        • 01-Common_Android_System_Customizations
        • 01-Common_Android_System_Customizations
      • 07-Linux_System_Customization
        • 01-Common_Linux_System_Customization
        • 02-Installing_VNC_on_Linux
        • 03-Linux_Docker
        • 04-Linux_QT_Environment_Setup
        • 05-Linux_NPU_YOLOV5S_object_detection
      • 08-Advanced_Topics
        • 01-Hardware_Factory_Test
        • 02-Hardware_Aging_Test
        • 03-Firmware_Unpacking_and_Packing
    • zh
      • 01-主板介绍
        • 01-RK芯片对比介绍
        • 02-KICKPI-K1硬件介绍
        • 03-KICKPI-K1B硬件介绍
        • 04-KICKPI-K3硬件介绍
        • 05-KICKPI-K8硬件介绍
      • 02-入门必读
        • 01-网盘目录说明
        • 02-K1-快速使用
        • 02-K1B-快速使用
        • 02-K3-快速使用
        • 02-K8-快速使用
        • 03-功能测试
        • 04-拓展引脚
      • 03-镜像烧录
        • 01-获取镜像文件
        • 02-USB线烧录
      • 04-SDK编译
        • 01-编译环境搭建
        • 02-LINUX_SDK编译
        • 03-ANDROID_SDK编译
      • 05-外设驱动
        • GPIO
        • Kernel
        • LCD
        • PWM
        • RTC
      • 06-ANDROID系统定制
        • 01-Android常用系统定制
        • 07-Android NPU YOLOV5 目标检测
      • 07-LINUX系统定制
        • 01-Linux常用系统定制
        • 02-Linux安装VNC
        • 03-Linux Docker环境搭建
        • 04-Linux QT环境搭建
        • 05-Linux NPU YOLOV5S 目标检测
      • 08-进阶
        • 01-硬件工厂测试
        • 02-硬件老化测试
        • 03-固件解包和打包
  • K7(RK3576)
    • en
      • 01-Development_board_Introduction
        • 01-KICKPI-K7_Hardware_Introduction
      • 02-Getting_Started_Guide
        • 01-KICKPI_Cloud_Storage_Introduction
        • 02-Quick_Start_Guide
        • 03-Functional_Testing
        • 04-Expansion_Pins_Testing
      • 03-Image_Flashing_Guide
        • 01-How_to_Get_Image_File
        • 02-USB_Cable_Flashing
      • 04-SDK_Compilation_Guide
        • 01-Compilation_Environment_Setup
        • 02-Linux_SDK_Compilation
        • 03-Android_SDK_Compilation
      • 05-Drivers_Development
        • ADC
        • PWM
      • 06-Android_System_Customization
        • 01-Android_Common_System_Customization
      • 07-Linux_System_Customization
        • 01-Linux_Common_System_Customization
        • 02-Linux_Docker_Environment_Setup
        • 03-Linux_NPU_YOLOv5s_Object_Detection
        • 04-Linux_DeepSeek_Large_Model
        • 05-Linux_VNC_Remote_Control
      • 08-Advanced_Topics
        • Advanced_Testing
    • zh
      • 01-主板介绍
        • 01-KICKPI-K7硬件介绍
      • 02-入门必读
        • 01-网盘目录说明
        • 02-快速使用
        • 03-功能测试
        • 04-拓展引脚
      • 03-镜像烧录
        • 01-获取镜像文件
        • 02-USB线烧录
      • 04-SDK编译
        • 01-编译环境搭建
        • 02-Linux_SDK编译
        • 03-Android_SDK编译
      • 05-外设驱动
        • ADC
        • PWM
      • 06-ANDROID系统定制
        • 01-Android常用系统定制
      • 07-LINUX系统定制
        • 01-Linux常用系统定制
        • 02-Linux Docker环境搭建
        • 03-Linux NPU YOLOV5S 目标检测
        • 04-Linux_Deepseek大模型
        • 05-Linux_VNC远程控制
      • 08-进阶
        • 进阶测试
  • K4B(T113-S3)
    • T113-S3中文文档
      • 01-KICKPI-K4B硬件介绍
      • 10-系统镜像烧录
      • 11-SDK源码编译
      • 12-硬件功能测试
      • 13-硬件工厂测试
      • LCD功能调试
      • 20-Ubuntu20.04系统定制
      • Buildroot_QT5配置
      • Buildroot系统定制
  • common
    • en
      • adb
        • ADB_Tutorial
      • allwinner_burnning
        • SD_Card_Flashing
        • USB_Cable_Flashing
      • debug
        • 01 - Log Collection
      • display
        • FPC_Interface_Introduction
      • linux
        • SSH
    • zh
      • adb
        • ADB教程
      • android
        • qt
      • debug
        • 01-日志抓取
        • 常见问题
      • display
        • FPC接口介绍
      • linux
        • SSH
        • VNC
        • qt
      • 全志烧录
        • SD卡烧录
        • USB线烧录
Powered by GitBook
On this page
  • 1. QT Runtime Environment Testing
  • Ubuntu 20.04
  • Debian 11
  • 2. QT Cross - Compilation Environment Setup
  • GCC Cross - Compilation Tools
  • QMake Tool Installation
  • Install Qt Creator
  • QT Cross - Compilation Kit Configuration
  1. K1/K1B/K3/K8(RK356x-RK3588)
  2. en
  3. 07-Linux_System_Customization

04-Linux_QT_Environment_Setup

1. QT Runtime Environment Testing

Ubuntu 20.04

The Ubuntu 20.04 system has the QT 5.12.8 runtime environment pre - configured by default.

To view the QT libraries:

$ ls -l /usr/lib/aarch64-none-linux-gnu/libQt*

The test demo is located in the network drive directory:

3-SoftwareData Software Materials\Qt_demo\mainwindow

Copy the demo to any directory in the system and conduct the test:

$ sudo chmod +x ./mainwindow
$ sudo ./mainwindow

Debian 11

The Debian 11 system has the QT 5.15.2 runtime environment pre - configured by default.

To view the QT libraries:

$ ls -l /usr/lib/aarch64-none-linux-gnu/libQt*

The test demo is located in the network drive directory:

3-SoftwareData Software Materials\Qt_demo\mainwindow

Copy the demo to any directory in the system and conduct the test:

$ sudo chmod +x ./mainwindow
$ sudo ./mainwindow

2. QT Cross - Compilation Environment Setup

Test platform: Virtual machine Ubuntu 20.04

GCC Cross - Compilation Tools

Virtual Machine: You can obtain it from the network drive. The network drive path is:

rk356x_data\3-SoftwareData Software Materials\gcc

The SDK comes with a cross - compilation toolchain: (Not recommended as version incompatibilities may occur)

(SDK)/prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/
  • GCC Cross - Compilation Chain Installation Place the obtained compressed package in the virtual machine directory and extract it:

$ sudo tar -xvf gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz -C /opt/gcc-arm

-C /opt/gcc-arm specifies the extraction path.

  • Environment Variable Configuration To enable the system to recognize the cross - compilation toolchain, you need to add its path to the environment variables.

Temporary Effect (Valid only for the current terminal session) Run the following command:

$ export PATH=/opt/gcc-arm/bin:$PATH

Permanent Effect Edit the user or system environment variable configuration file.

$ sudo vim /etc/profile
export PATH=/opt/gcc-arm/bin:$PATH
source /etc/profile

Verify the installation Run the following command to verify whether the toolchain is successfully installed and configured:

aarch64-none-linux-gnu-gcc --version

If the output is similar to the following, the installation is successful:

aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture) 9.2.1 20191203
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

QMake Tool Installation

If you want to install QT on the board, install GCC on the board. There is no need to modify the compilation tools. Just install the source code.

The qmake tool is used to generate MakeFiles for Qt projects based on the project file (.pro). For simple projects, you only need to run qmake in the top - level directory of the project. By default, qmake will generate a MakeFile for building the project. At this time, you can run the platform - related make tool to build the project.

  • The network drive only provides one version of QT:

rk356x_data\5-DevelopmentTools Development Tools\QT

Visit the official website and select the version you need to download.

Select "single".

Select "tar.xz".

Install dependencies:

$ sudo apt-get install build-essential perl python3 git
$ sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
$ sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby
$ sudo apt-get install libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libxtst-dev libxss-dev libdbus-1-dev libevent-dev libfontconfig1-dev libcap-dev libpulse-dev libudev-dev libpci-dev libnss3-dev libasound2-dev libegl1-mesa-dev gperf bison nodejs
$ sudo apt-get install libasound2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev 
$ sudo apt-get install libgstreamer-plugins-bad1.0-dev
$ sudo apt install clang libclang-dev
$ sudo apt-get install xz-utils
$ sudo ln -s /usr/bin/python3 /usr/bin/python

After downloading, extract it in the /opt folder:

$ sudo tar -xvf qt-everywhere-src-5.12.2.tar.xz -C /opt/

After extraction, enter the folder and create an auto.sh script file.

$ sudo vim auto.sh
#!/bin/bash

./configure \
    -prefix /opt/Qt/ \
    -opensource -confirm-license \
    -nomake examples \
    -nomake tests \
    -release \
    -xplatform linux-aarch64-gnu-g++ \
    -device-option CROSS_COMPILE=/opt/gcc-arm/bin/aarch64-none-linux-gnu- \
    -no-eglfs \
    -no-xcb \
    -no-opengl \
    -skip qt3d \
    -skip qtcharts \
    -skip qtandroidextras \
    -skip qtlocation \
    -skip qtmultimedia \
    -skip qtsensors \
    -skip qtserialbus \
    -skip qtserialport \
    -skip qtwayland \
    -skip qtdeclarative \
    -skip qtxmlpatterns \
    -skip qtwebchannel \
    -skip qtwebengine \

Modify the qmake.conf file There are various platforms in the qtbase/mkspecs/ directory of the QT source code. In our example, we use the qmake configuration file in the linux - aarch64 - gun - g++ directory. However, since the cross - compilation tools are different, we need to modify the qmake.conf file to adapt to the tools.

# modifications to g++.conf
QMAKE_CC                =/opt/gcc-arm/bin/aarch64-none-linux-gnu-gcc
QMAKE_CXX               =/opt/gcc-arm/bin/aarch64-none-linux-gnu-g++
QMAKE_LINK              =/opt/gcc-arm/bin/aarch64-none-linux-gnu-g++
QMAKE_LINK_SHLIB        =/opt/gcc-arm/bin/aarch64-none-linux-gnu-g++
 
# modifications to linux.conf
QMAKE_AR                =/opt/gcc-arm/bin/aarch64-none-linux-gnu-ar cqs
QMAKE_OBJCOPY           =/opt/gcc-arm/bin/aarch64-none-linux-gnu-objcopy
QMAKE_NM                =/opt/gcc-arm/bin/aarch64-none-linux-gnu-nm -P
QMAKE_STRIP             =/opt/gcc-arm/bin/aarch64-none-linux-gnu-strip

Run the script to cross - configure the QT source code:

$ sudo chmod 755 auto.sh
$ sudo ./auto.sh

The script is used to execute ./configure -prefix /opt/Qt/ \ Qt installation path -opensource -confirm-license \ Installation version, community edition or commercial edition -nomake examples \ Do not compile and install examples -nomake tests \ Do not compile and install tests -release \ Release compilation -xplatform \ Specify the target platform -skip \ Skip compiling modules

qtlocation and qtwebengine. If you don't particularly need these two modules, it is recommended to skip compiling them. These commands are described in the README after extraction. After execution, make improvements according to the prompts. Most of the prompt errors are due to incomplete dependency installation.

Execute the compilation:

$ sudo make -j4

It takes a long time, about 4 - 12 hours depending on the performance.

After completion, execute:

$ sudo make install

This command will install the program in the /opt/Qt/ directory specified by -prefix above. After successful installation, modify the environment variables:

$ sudo vim /etc/profile
export QTDIR=/opt/Qt
export PATH=$QTDIR/bin:$PATH
export MANPATH=$QTDIR/man:$MANPATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
$ source /etc/profile

Finally, execute:

$ qmake -v

Install Qt Creator

You must install Qt first before installing Qt Creator. Compile Qt Creator with Qt. If there is an error in compiling Qt, there will also be an error in this step. If there are uncompiled modules or non - dependent modules during Qt compilation, Qt compilation will not be affected, but Qt Creator will be affected. I tried adding -no - opengl . There was no error in compiling Qt, and the installation was successful, but there was an error in compiling Qt Creator.

  • You can choose to install the package program on the virtual machine. At the same time, you can install other packages that run on the local machine.

After downloading, extract it. Assuming the above tutorial has been completed: Enter the extraction path and execute:

$ qmake -r

Wait for the completion to generate the MakeFile file. Then execute:

$ sudo make -j4

Wait for the compilation to complete, and then execute:

$ sudo make install

After execution, Open the bin folder, and there will be qtcreator and qtcreator.sh. Execute:

$ ./qtcreator.sh &

In this way, Qt Creator will run in the background. Finally, configure Qt Creator.

QT Cross - Compilation Kit Configuration

The following introduces the configuration of using cross - compilation tools when creating a QT project in QT. The Kits mainly select GCC and G++ from the cross - compilation toolchain, and use the compiled qmake for qmake.

Last updated 4 days ago

Download Qt from the official website Official website links:

image-20241028093459681
image-20241028093254591
image-20241028093434074
image-20241028094050024
image-20250219155414011

Download it and run the installation program in the virtual machine. It is best to match the Qt Creator version with the Qt version.

image-20241028094210629

Add C and C++ in GCC:

Add qmake:

Final configuration:

Unmaintained Qt versions
Maintained Qt versions
Qt Creator source code