For some Linux CDs, contact me if you need them. QQ is 602559817, and a maximum of three
No touch screen support is added here: tslib
Download qt-embedded-linux-opensource-src-4.5.2
Saved as two folders: XXX-PC and XXX-arm.
At the same time in order to get qvfb (previous useless, version is not correct), download the qt-x11-opensource-src-4.5.2, directly decompress.
* First, in order to get qvfb, enter the qt-x11-opensource-src-4.5.2 directory. In the online tutorial, you only need to go to tools/qvfb and copy two files, qmake-project; qmake; make. But I am reporting an error here .. no UIC exists in/bin/, and you still need to compile it yourself. So I began to compile this huge thing:
1. Configure, in fact, is only for obtaining a UIC and qvfb. If you compile the entire file, it will take a long time. I have learned a lesson from this. Ubuntu 8.04 system, the clock speed of 3G has been compiled for about 5 hours. Therefore, you need to remove a lot of useless things during configuration, such as WebKit and SQL. You can use./configure -- help to know what you don't need. However, qvfb is mandatory. Therefore, the cropping configuration command is not considered here:
./Configure-qvfb
2. After about 10 minutes of configuration, you can directly:
Make
3. After about five hours, do not make install. Go to the tools/qvfb directory and copy the deviceskin under tools/shared/deviceskin. h, deviceskin. CPP to this directory, and then create a project:
Qmake-Project
Then
Qmake
Then modify the generated MAKEFILE file and add-lxtst to the libs file. (If you do not have this library, you must install sudo apt-Get install libxtst-dev yourself)
Make
This is the executable file generated for qvfb.
** Next, go to the qt-embedded-linux-opensource-src-4.5.2-pc and build a library for simulated development on the PC.
1,./configure
The above configuration, the default configuration options can be viewed through./configure --- help. You have your own configuration for cropping.
My configuration here is:./configure-opensource-qvfb-no-qt3support-no-WebKit-platform Linux-G ++
2, make
I compiled the above configuration for about 3 hours.
3. sudo make install
Because no installation path is specified during configuration, it is mounted under/usr/local/trolltec/QtEmbedded-4.5.2-i386/
4. Test
First run the compiled qvfb, and then enter the xxx/trolltec/QtEmbedded-4.5.2-i386/example, run a sample program, such as./Application-qws, you can see in qvfb.
5. To compile your own program, you need to configure environment variables. In order to run some programs in Kde, qt4 has been installed using apt, so qmake has been installed in the system. If you want to use the compiled environment, you need to adjust the environment variable to use the new one. In fact, if you do not use this, you can also use apt to simulate development on the PC.
Quick installation is available here:
Sudo apt-Get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos qt4-designer
The above can have the basic PC on the qt compiling environment, but the strange is that qt3 has a qt3-embedded-tools package, 4 but not, so the previous tedious work to compile qvfb.
If you use the compiled environment, you need to set the following environment variables: (this part will be completed after you actually use QT development)
* ** Finally, the QT library must be compiled.
1. Go to the qt-embedded-linux-opensource-src-4.5.2-arm directory and configure. My configuration is as follows:
. /Configure-xplatform qws/Linux-arm-G ++-Embedded ARM-little-Endian-opensource-no-largefile-no-qt3support-no-WebKit-QT-GFX-linuxfb-depths 16/
-QT-KBD-tty-QT-KBD-USB-QT-mouse-PC-QT-mouse-bus-QT-mouse-yopy-QT-zlib-QT-GIF-QT -libpng-QT-libjpeg
Here is just an experimental configuration. You can crop it if necessary. But there are a few points to note here, and I don't know if it is unique to me:
A, I tried to define-Prefix as the directory where arm is located, but there are always errors in the compilation process, so it is still installed in the default directory;
The error is as follows:
/Media/f/QT/qt-embedded-linux-opensource-src-4.5.2-arm/bin/MoC: Error while loading shared libraries:/usr/local/ARM/3.4.1/ARM-Linux/lib/libdl. so.2: ELF File OS Abi invalid
B, for the cross compiler, I am on the arm-linux-3.4.1, the low version is useless, this has instructions on the official website;
C. There is no special choice for the input device, and I think it is possible to choose either of them.
For more detailed configuration parameters, see the description in configure -- help, especially the description for the embedded section;
2. After configuration
3. After make is complete, sudo make install. Because it is installed in the default directory (/usr/local/trolltech/QtEmbedded-4.5.2-arm), so use sudo;
4. After installation, the online tutorial says you should set various environment variables to configure the QT development environment. I didn't configure the qvfb simulated development environment here, So I directly configured it as a cross-compilation environment.
Because various QT components have been installed in the system, in order to call cross-compiled qmake during compilation ~ /. Added under bashrc:
Export Path =/usr/local/trolltech/QtEmbedded-4.5.2-arm/bin: $ path
In this case, the qmake under arm is preferentially called. However, after the configuration takes effect (usually restart shell or source ~ /. Bashrc), execute the command which qmake to see the specific path, But the strange thing is that whereis qmake is quite dead.
5. I only set this environment variable, then write a hello World, and save it as main. cpp.
# Include
# Include
Int main (INT argc, char * argv [])
{
Qapplication app (argc, argv );
Qlabel label ("Hello, world! From ZHS ");
Label. Show ();
Return app.exe C ();
}
Then run: qmake-project; qmake; make to generate the program running on the arm. You can check whether CC and cxx in makefile are arm-Linux-G ++ to determine whether cross-compilation is performed.
* *** Port
Finally, we need to port the cross-compiled library to the board. First, mount the file directly with NFS, so you don't have to consider what you need or what you don't want. All of them are moved to the directory. You can crop the file later.
1. Copy the/usr/local/trolltech/QtEmbedded-4.5.2-arm directory to the rootfs/usr/local/trolltech directory, that is, keep the same path with the PC;
Although it can be another path, it requires complicated environment variable settings and other settings. Everything is simplified here.
2. In this way, I enter 4.5.2-arm/example/, because I did not ignore example during configure, so I can execute the sample program:
./Test-qws
You may be reminded that some databases cannot be found, copy the relevant library in/usr/local/ARM/3.4.1/ARM-Linux/lib/to the library directory on the board;
3. Generally, the program runs normally and the Self-written Hello world runs normally. However, for my at91rm9200 179mhz CPU, QT is still very CPU-consuming, and the memory of the sample program should be at least 10 MB, which is terrible, I don't know if it is a new version. I need to evaluate it later.
* ***** Summary:
E-mail: GaussCheng@gmail.com
System Environment: Ubuntu 9.04
Compiling environment: After installing crosstool 0.43, generate the arm-Linux-GCC version 4.1.
Before configuration, sudo apt-Get install build-essential to install the basic development environment
Qtx11 (source code installation) Installation preparation
We recommend that you directly install the binary program.
1. Install the dependent library. You can also add it when an error occurs during installation.
Sudo apt-Get install libxrender-dev libxrandroid-dev libxcursor-dev libxinerama-dev libxi-dev libxt-dev libglib2.0-Dev-libxtst-Dev
This was tracked one by one based on qtx11 compilation errors after I installed the system. It cannot be guaranteed that it is all installation dependencies.
2. Enter the source code top-level directory Input
./Configure-QT-SQL-SQLite-plugin-SQL-SQLite-nomake demos-nomake examples-silent
You can filter the compilation parameters according to the prompts in./configure-help.
Qt-embedded installation preparation
1. if your cross tool group starts with "arm-Linux-", you can directly perform the following steps. Otherwise, you must have two methods. One is to provide a soft connection to your tool group, however, their prefix is arm-Linux -. This method is recommended. Second, open the source code directory of QT-embedded and modify mkspecs/qws/Linux-arm-G ++/qmake. conf, replace the arm-Linux-in it with the prefix of your cross-compilation tool.
2.
Open qt-embedded-linux-opensourcesrc4.5.2/src/GUI/Embedded/qmouselinuxtp_qws.h
I have added the following two macro definitions to my account. I don't know why, but I still hope you can help me. This is what I have seen on the Internet. I have tried not to add them, the program compiled by the QT-embedded library generated by the configuration options below cannot use the touch screen. If the tslib touch screen driver has been successfully transplanted, share it with you.
# Define qt_qws_ipaq
# Define qt_qws_ipaq_raw
3. Enter the source code top-level directory input:
. /Configure-Embedded ARM-little-Endian-QT-SQL-SQLite-plugin-SQL-SQLite-no-scripttools-no-Nis-no-largefile-no-libmng-no- accessibility-Depths 16-nomake docs-nomake demos-nomake examples-QT-zlib-feature-thread-feature-Concurrent-feature-sound-feature-effects-no-feature-cursor- silent
Similarly, the preceding configuration parameters can be tailored to embedded applications to remove unnecessary items, which is very important for embedded applications, this not only saves space but also increases efficiency.
Install QT creator
Qt creator is a lightweight ide. I use it to facilitate cross-Compilation of QT programs.
1. If qtx11 is installed from the source code without QT creator, you can download binary program installation from the official website. After installation, open QT creator-> Tools-> options, expand qt4 in the left-side Navigation Pane, and select QT versions. Click the plus sign on the upper right. You can enter the version name to differentiate the versions of QT libraries such as x86 and arm. Select the path for installing the qtx11 library before, the default installation is in/usr/local/trolltech/QtEmbedded-4.5.2, and then click rebuild, if you see a check, everything works. Similarly, you can add the QTE-arm library.
2. now you can create a project for fun, or find the source code package of QT-embedded, which contains a touch screen correction program, which is required by embedded devices in example/qws/mousecalibration, otherwise, the touch screen cannot be used. Use QT creator to open the mousecalibration. Pro file. On the left side of QT creator, click projects. On the build Settings check box, select the name you set for the QTE-arm library before QT version, and then build the QT program suitable for the Development Board.
Configure environment variables to facilitate calling qmake MOC and other programs with other ide and command lines
Open it in the editor ~ The/. profile file is added as follows. Save and deregister the file to take effect.
# Set path so it should des qt4.5.2 X11 bin if it exists
If [-d "/usr/local/trolltech/Qt-4.5.2/bin"]; then
Path = "/usr/local/trolltech/Qt-4.5.2/binpath"
Fi
Qt File System Configuration
Preparation
1. Create the/opt/QT/bin lib plugins folder in the root file system.
2. put libqtcore in/usr/local/trolltech/QtEmbedded-4.5.2-arm/lib (that is, the installation directory of QT-embedde library. so.4.5.2 libqtgui. so.4.5.2 libqtnetwork. so.4.5.2 put it in/opt/QT/lib of the development board root file system, and make three soft links: libqtcore. so.4 libqtgui. so.4 libqtnetwork. so.4
3. Then copy the file with Vera and fixed in/usr/local/trolltech/QtEmbedded-4.5.2-arm/lib/fonts/to the/opt/QT/lib/fonts/
4. copy the files in/usr/local/trolltech/QtEmbedded-4.5.2-arm/plugins/imageformats to/opt/QT/plugins/imageformats in the root file system.
5. Now the basic QT library has been transplanted. When porting an application, run the following command to view the required shared libraries:
Arm-Linux-readelf-a program name | grep "share", where arm-Linux-can be prefixed with your cross-compilation tool
Configure the root file system
In general, the first thing to do is to put a touch screen correction program in the bin of the file system (in fact, there are all the same ). Then write a script program to call it when the system starts up. My script program initqt is as follows (don't forget to add executable permissions to it ):
#! /Bin/sh
Export Home =/root
Export qtdir =/opt/QT
# Used to select the linuxtp mouse driver
Export set qws_mouse_proto = "linuxtp:/dev/h3600_tsraw"
Export qws_display = "linuxfb:/dev/fb0"
# Used to adjust the font display ratio. You can change the value to see the effect.
Export qws_display = "linuxfb: mmwidth130: mmheight100: 0"
Export qws_size = "320x240"
Export qt_plugin_path = $ qtdir/plugins/
# Font directory
Export qt_qws_fontdir = $ qtdir/lib/Fonts
Export Path = $ qtdir/binpath
Export LD_LIBRARY_PATH = $ qtdir/libqtdir/plugins/imageformatsld_library_path
# Determine whether the screen has been corrected
If [-s "ETC/pointercal"]; then
Else
/Bin/mousecalibration
Fi
Configure the/etc/profile file to make environment variable logon effective. The following is my Configuration:
# Ash Profile
# VIM: syntax = sh
# No core files by default
# Ulimit-s-c 0>/dev/null 2> & 1
User = "'id-UN '"
LOGNAME = $ user
PS1 = '[/u @/h/W] #'
Path = $ path
Hostname = '/bin/hostname'
Export user LOGNAME PS1 path
Export Home =/root
Export qtdir =/opt/QT
Export set qws_mouse_proto = "linuxtp:/dev/h3600_tsraw"
Export qws_display = "linuxfb:/dev/fb0"
Export qws_display = "linuxfb: mmwidth130: mmheight100: 0"
Export qws_size = "320x240"
Export qt_plugin_path = $ qtdir/plugins/
Export qt_qws_fontdir = $ qtdir/lib/Fonts
Export Path = $ qtdir/binpath
Export LD_LIBRARY_PATH = $ qtdir/libqtdir/plugins/imageformatsld_library_path
Finally, add/bin/initqt &