The QT/E 3.x series has been greatly improved over the QT/E 2.x series, greatly improving the development progress. It no longer uses tmake, and the installation is also simpler. However, there are still relatively few introductions to the QT/E 3.x series on the Internet,
so this article introduces the installation of the QT/E 3.x series.
1. Establish an arm cross-compilation tool chain
Before installing QT/E, you should ensure that the arm-linux cross-compilation tool chain has been established. If it has not been established, you can refer to the following steps to establish it.
1. Download the cross-compilation tool cross-2.95.3.tar.bz2 (or other versions such as: cross-3.4.4.tar.bz2). This is the arm cross-compilation tool chain that has been made. You only need to unzip it and establish the environment variables to use it.
2. Copy the file cross-2.95.3.tar.bz2 to a folder. Here I use: /usr/local/arm. Note that you must correspond to it when establishing the environment variables later.
3. Unzip tar -xjvf cross-2.95.3.tar.bz2
4. Create environment variables Copy the content to the clipboard Code:
export PATH=/usr/local/arm/2.95.3/bin:$PATH Or you can write it into the file ~/.bashrc, so you don't have to export it every time you start the computer. Copy the content to the clipboard Code:
vi ~/.bashrc
Add export PATH=/usr/local/arm/2.95.3/bin:$PATH at the end. The arm-linux cross-compilation tool chain has been built.
2. Compile QT
1. QT/E free version can be downloaded from the official website ftp. The website is: ftp://ftp.trolltech.com/qt/source/ . You can choose a version to download. I personally think that QT/E 3.x series is easier to use,
but there is more information on QT/E 2.x series on the Internet. But it is recommended not to use the qt/e 3.3.x version, because in the process of my development, I have tried qt/e 3.3.4 and qt/e3.3.8, and found that they occupy a
very high CPU resource on the ARM development board, and have been occupying about 98% of the CPU. Now I have not found the reason. I wonder if any friends have encountered this problem. It is recommended to use the qt/e 3.1.0 version. I am using it and have not encountered any problems.
(Note: The problem has been solved. It turned out that the keyboard interface was not done well. I will share the process of transplanting the keyboard interface with you when I have time)
2. Here, I assume that qt-embedded-free-3.1.0.tar.bz2 is used
3. Copy the file qt-embedded-free-3.1.0.tar.bz2 to a folder. Here I use: /usr/local/arm. Note that it should correspond to it when you create the environment variable later.
4. Unzip tar -xjvf qt-embedded-free-3.1.0.tar.bz2
and change the unzipped folder qt-embedded-free-3.1.0 to qte. (You don't have to change it, it's for convenience. Note that you have to correspond to it when you create environment variables later)
mv qt-embedded-free-3.1.0 qte
5. Create environment variables
vi ~/.bashrc
and add the code to copy the content to the clipboard at the end:
export QTDIR=/usr/local/arm/qte
export QTEDIR=$QTDIR
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH (Please log in again to make the environment variables take effect)
6. Configure QT
Enter the QT/E directory: cd $QTDIR
Input: ./configure -embedded arm -thread -no-cups -qvfb -depths 4,8,16,32
The above options: -embedded arm means the target platform is arm; -thread means support for qt threads, which I use in my development; -qvfb means support for the virtual buffer frame tool qvfb;
-depths 4,8,16,32 means support for 4, 8, 16, 32-bit display color depth. There are many more options that I will not list one by one, please check ./configure -help.
In addition, there is an option I did not use, which is -qconfig local. You can write some switch variables into a file qconfig-local.h and put it under $QTDIR/src/tools.
You can refer to the qconfig-small.h, qconfig-medium.h, qconfig-large.h and other files in this directory, or use them directly, such as: -qconfig small. Through these switch variables,
some unnecessary components in development can be removed to reduce the size of the qt library. You need to be familiar with QT here, and beginners can ignore it for now.
(I once encountered an error when compiling the $QTDIR/include/qvaluestack.h file at home. Later, I copied the corresponding file of qt3.3.8 and overwrote it, and it passed.
I guess it was incompatible with the gcc version. I have never encountered this problem in the company.)
7. Compile
make sub-src // Specify to compile the development package in a streamlined way, that is, some Qt classes are not compiled
.
8. Test
At this point, the compilation work is completed. Finally, test whether it can be used normally. We can use the examples that come with QT to test, such as:
cd $QTDIR/examples/aclock // or you can create a new QT project
make clean // clear the original
rm *.pro Makefile // delete and re-create the project file
qmake -project
qmake -spec $QTDIR/mkspecs/qws/linux-arm-g++ -o Makefile
-spec specifies the configuration file of the target board. Here I am working on the linux arm platform. Note that here, $QTDIR/mkspecs/qws/linux-arm-g++ is not a compiler, but a configuration file,
and the compiler used for compilation is the compiler in the arm cross-compilation tool chain we established in the first step. If
make
does not make any mistakes, it means that your QT/E environment has been successfully established. If it says cannot find -lqte, then try to modify the Makefile file, find -lqte, change it to -lqte-mt
and make it again. It will usually work. This is because if QT threads are used or for some other reasons, the library it generates is no longer libqte.so.3.1.0, but libqte-mt.so.3.1.0, so it cannot be found.
3. Porting to the development board (the following are all in the target machine environment)
1. Create a new directory, such as: /qt/lib. Enter this directory cd /qt/lib
2. Download the Qt library file libqte-mt.so.3.1.0 generated above to the development board /qt/lib/directory through ftp. (Note: do not use wget to download, it will damage the library file,
resulting in errors such as ld.so: dynamic-link.h: 62: elf_get_dynamic_info: Assertion `! "bad dynamic
tag
"
'
... libqte-mt.so.3
ln -s libqte-mt.so.3.1.0 libqte-mt.so.3.1
4. Create environment variables
vi ~/.bashrc
and add the code to copy the content to the clipboard at the end:
export QTDIR=/qt
export QTEDIR=$QTDIR
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH4. The target board environment has been built. Now you can download the above example aclock to the target board and try to see if it can run!
Enter in the development board console: ./aclock -qws
If it can run but the keyboard cannot be used, it is normal because the interfaces of keyboard, mouse and other devices have not been added to QT/E. This cannot be explained in one or two sentences, so I will add it later!
One more thing: If there is a prompt like this: "./aclock:error while loading shared libraries: libstdc++.so.6: cannot load shared object file: No such file or directory." You can find the corresponding library file in the /usr/local/arm/2.95.3/arm-linux/lib/directory in the arm cross-compilation tool chain we built in the first step and download it to the /lib directory of the development board. --
Previous article:Analyzing the startup process of STM32
Next article:ARM Advanced Learning (5) - ARM ISP Operation
Recommended ReadingLatest update time:2024-11-16 16:29
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications