If the article is an original article, please indicate the source of the original article when reprinting it.
The blog address of this article: https://hpzwl.blog.csdn.net/article/details/132733901
Rockchip Development Column
Previous article: " RK3568 Development Notes (6): Development board to program Ubuntu firmware (supports mipi screen mirroring + HDMI screen mirroring) " Next article: " RK3568 Development Notes (8): Development board to program buildroot firmware ( Supports mipi screen mirroring + HDMI screen mirroring) hdmi screen), build a Qt cross-compilation development environment, compile a Demo, and run the Demo test on the target board》
Preface
In the previous blog post, a relatively complete ubuntu host has been built. It is very complete, but I found that there is no Qt cross-compilation development environment, so I still need to build a Qt cross-compilation development environment.
Additional information
This article is based on Qt cross-compilation on a virtual machine based on "RK3568 Development Notes (3): RK3568 Virtual Machine Basic Environment Construction Update Source, Installation of Network Tools, Serial Port Debugging, Network Connection, File Transfer, Installation of vscode and Samba Shared Services" Built.
Install desktop version of Qt on ubuntu
(PS: This is the ubuntu development environment for installing qt, including the desktop compilation board of qtcreator and a compiler that supports gcc.)
Step 1: Download Qt5.14.2
Step 2: Install the desktop board
(PS1: When installing qt, please disconnect from the Internet first, otherwise you must log in)
(PS2: qt5.14.2 is the official version, it is best not to change the version yourself unless necessary)
After the installation is complete, open QtCreator, as shown below:
Create a hello world application Demo
Step 1: Create a new Qt project
Create a new testDemo test project:
Note here that this is the desktop gcc version:
Step 2: Make a simple project
Let it use the full screen/normal display toggle:
Step 3: Run the test locally
Click "Full Screen Switch":
Build a cross-compiled Qt compiler on ubuntu (test the official buildroot qt board)
(PS: What is officially provided is the qt cross-compilation environment of buildroot. Here we first test whether we can use this board for display).
Step 1: Download and unzip
Download the official package for compiling qt:
Put it on the host machine and unzip it:
Step 2: Open the QtCreator configuration environment
Configure qmake of Qt board
Configure the cross compiler gcc
Then create a new compilation package:
Step 3: Switch the project to the buildroot package
Step 4: Compile the project
Step 5: Get it on the development board and use sftp to get there
Ubuntu comes with the commonly used ssh and stfp. The username and password are both topeet, so you can use the regular filezile method to pass them over. Run and find few libraries. First test a simple c project, and then see if it is necessary to transplant the qt stuff:
Find the cross-compiler folder, it is in sysroot:
Get it to him:
Check sysroot:
Didn't find a copy? (It used to be usr/lib, this is now in usr/local/lib)
Copy again (I found that Qt5 is also there, so I saved it and did it separately):
Copy failed and found that the size is not enough (the lib package has 1.4 G, which is less than 800MB. Even if the full library of Qt is extracted separately, it is more than 800MB, as a person):
summary
Those compiled with the cross-compiler of buildroot-qt can be put on Ubuntu, because their kernel and cross-compiler board are the same, and Ubuntu is also built with a cross-compiler.
But because the space is small, libraries with qt cannot be transplanted (Qt, ffmpeg, and Qt applications will need to be transplanted later, which is relatively troublesome, so I will not continue). Change the buildroot system (because qt has already been done) Library, then Ubuntu originally thought it supported additional USB touch screens, but now it does not support it, so it is more appropriate to replace the buildroot)
Previous article: " RK3568 Development Notes (6): Development board to program Ubuntu firmware (supports mipi screen mirroring + HDMI screen mirroring) " Next article: " RK3568 Development Notes (8): Development board to program buildroot firmware ( Supports mipi screen mirroring + HDMI screen mirroring) hdmi screen), build a Qt cross-compilation development environment, compile a Demo, and run the Demo test on the target board》
If the article is an original article, please indicate the source of the original article when reprinting it.
The blog address of this article: https://hpzwl.blog.csdn.net/article/details/132733901