Embedded learning-transplantation and testing of QT

Source: Internet
Author: User

I would like to thank the teachers of the old house for their materials and sorting out the problems as follows:

Edit Environment: ubantu 11.04 arm-Linux-GCC 4.3.2 OK 6410 Development Board

1. Compile and port tslib1.4

(1gz extract tslib1.4.tar.gz (can be downloaded from my resources)

Tar xzvf tslib1.4.tar.gz

CD tslib

(2)./autogen. Sh // used to produce configure

(3)./configure -- prefix =/usr/local/tslib/-- Host = arm-Linux ac_cv_func_malloc_0_nonnull = Yes

(4) make

(5) make install

After compilation and installation, you can see the compiled programs and libraries in the/usr/local/tslib directory of the host.

(6) modify the Ts. conf file in the/usr/local/tslib/etc directory and remove the comments and spaces before module_raw input. Otherwise, some inexplicable errors may occur!

2. Compile QT

Download qt-everywhere-opensource-src-4.7.3.tar.gz from the Internet (or download it from me)

Decompress the qt-everywhere-opensource-src-4.7.3.tar.gz package

Tar xzvf qt-everywhere-opensource-src-4.7.3.tar.gz

CD qt-everywhere-opensource-src-4.7.3

(2) Configure QT (you can crop QT here). Do not make any mistakes!

. /Configure-opensource-confirm-license-release-shared-Embedded ARM-xplatform qws/Linux-arm-G ++-depths, 24, 32-fast-optimized-qmake-QT-SQL-SQLite-QT-libjpeg-QT-zlib-QT-libpng-QT-FreeType-little-Endian-host-little-Endian
-No-qt3support-no-LibTIFF-no-libmng-no-OpenGL-no-MMX-no-SSE-no-sse2-no-3dnow-no-OpenSSL-no-WebKit-no-qvfb-No -phonon-no-Nis-no-cups-no-glib-no-xcursor-no-xfixes-no-xrandroid-no-xrender-no-separate-debug-Info-nomake examples-nomake tools-nomake
Docs-QT-mouse-tslib-I/usr/local/tslib/include-L/usr/local/tslib/lib-d1_arm_arch_5tej __

[Note ]:

Compile and configure;

-Opensource

-Confirm-license

-Release

-Shared

-Embeddedarm

-Xplatform

Qws/Linux-arm-G ++)

-Depths4, 8, 16, 18, 24, 32

-Fast

-Optimized-qmake (generate qmake under arm)

The following are some plug-ins

-QT-SQL-SQLite (Add the database under QT)

-QT-libjpeg (JPEG image)

-QT-zlib (data compression)

-QT-libpng (PNG images)

-QT-FreeType

(FreeType library is a completely free (Open Source), high-quality and portable font engine)
-Little-Endian (small-end storage)

-Host-little-Endian (host small-end storage)

Remove the following plug-ins because they are designed to support the arm Development Board.

-No-qt3support (qt3 not supported)

-No-LibTIFF (remove the library that reads and writes the label Image File Format)

-No-libmng (library for making some animations)

-No-OpenGL (OpenGL is a professional graphics program interface and is a powerful and convenient underlying graphics library. It is not needed here)

-No-MMX (multimedia extensions are used for drawing)

-No-SSE (SSEIt is short for instruction sets. It includes 70 commands, including single commands, multi-data floating point calculation, and extra SIMD integers and high-speed cache control commands)

-No-sse2 (SIMD stream technology extension 2 or data stream Single Instruction Multiple Data extension Instruction Set 2) Instruction Set)

-No-3dnow (3dnow Instruction Set technology is actually 21 machine code extension Instruction Set)

-No-OpenSSL (a security protocol that provides security and data integrity for network communication)

-No-WebKit (WebKitIs an open-source browser engine)

-No-qvfb (qvfb is a virtual frambuffer application for qtopia, its ultimate goal is to display the results of the qtopia application program running on qvfb (in practice, it is based on Linux

The frambuffer driver is displayed on the LCD screen) and provides peripheral simulation of the keyboard and mouse. This facilitates the R & D phase, allowing users to complete qtopia debugging on the PC end, greatly improving work efficiency. )

-No-phonon)

-No-NIS (a firewall-like tool called "Norton Network Security" for short)

-No-Cups (Cups(Common Unix Printing System) is a printing system supported by fedora core3. It uses IPP (Internet Printing Protocol) to manage print tasks and queues)

-No-glib (used in the GTK Development Environment)

-No-xcursor)

-No-xfixes (XfixesIs an X Window System extension which makes useful additions to the X11 Protocol)

-No-xrandroid (window size resolution adjustment)

-No-xrender

-No-separate-debug-Info

-Nomakeexamples

-Nomaketools

-Nomakedocs

Set tslib to mouse drive and Calibration

-QT-mouse-tslib

-I/usr/local/tslib/include

-L/usr/local/tslib/lib

Support Arm architecture, 6410:-d1_arm_arch_5tej __

2440/10:-d1_arm_arch_4t __

-D1_arm_arch_4t __

(3) modify source code

Modify the qt-everywhere-opensource-src-4.7.3/mkspecs/qws/Linux-arm-G ++/qmake. conf file (add the LTS parameter ):

Qmake_cc = arm-Linux-gcc-lts

Qmake_cxx = arm-Linux-G ++-lts

Qmake_link = arm-Linux-G ++-lts

Qmake_link_shlib = arm-Linux-G ++-lts

Modifying qt-everywhere-opensource-src-4.7.3/src/3 rdparty/FreeType/include/FreeType/config/ftconfig. h

Set "Orr % 0, % 2, LSL #16/n/t"/* % 0 |=% 2 <16 */

Change to "Orr % 0, % 0, % 2, LSL #16/n/t"/* % 0 | = % 2 <16 */

Add % 0 before % 2.

(4) make

(5) make install

You can install QT on/usr/local/trolltech/QtEmbedded-4.7.3-arm

(6) prepare Chinese fonts and download the wenquanyi Font Library

Copy wenquanyi library to QtEmbedded-4.7.3-arm/lib/fonts;

3. Add it to the Development Board root file system

(1) copy the library required by the root file system/lib (the specific version is related. You can try a QT program to see what is missing). Generally, you can add the following:



These libraries can be obtained from the installation directory of arm-None-Linux-gnueabi libstdc ++, which are in the libc/usr/lib directory;

(2) Copy tslib and QT libraries to the root file system of the Development Board.

Copy the installed tslib directory to the/usr/local directory of the Development Board root file system;

Copy the installed QT directory QtEmbedded-4.7.3-arm to the/usr/local/trolltech of the development board root file system;

(3) create a QT configuration file

Create a profile file in the/etc directory of the root file system. The content is as follows:

Export qtdir =/usr/local/trolltech/QtEmbedded-4.7.3-arm

Export t_root =/usr/local/tslib

Export Path = $ qtdir/bin: $ path

Export tslib_consoledevice = none

Export tslib_fbdevice =/dev/fb0

Export tslib_tsdevice =/dev/event0

Export tslib_plugindir = $ t_root/lib/TS

Export tslib_conffile = $ t_root/etc/ts. conf

Export tslib_calibfile =/etc/pointercal

Export qws_mouse_proto = tslib:/dev/event1

Export LD_LIBRARY_PATH = $ t_root/lib: $ qtdir/lib

Note that the devices specified by tslib_tsdevice and qws_mouse_proto are related to the development board kernel, which may be different from the above;

(4) mount the root file system in NFS mode;

(5) input :/

/Usr/local/tslib/bin/ts_calibrate

Touch screen correction;

(6) Compile a program or use a sample program to verify

Write a QT program, and then use arm-gccCompile, such as your installed QT under/usr/local/trolltech/QT-EMbedded-4.7.3-arm

Command:

/Usr/local/trolltech/QT-EMbedded-4.7.3-arm/Bin/qmake-Project generation. Pro

/Usr/local/trolltech/QT-EMbedded-4.7.3-arm/Bin/qmake generate make

Make to generate executable files

Then copy the file to the root file system. For example, if my file is stored in/usr/local of the root file system

Enter the directory./*****-qws-font wenquanyi

You can run it (-font wenquanyi is the added font! The font is normal !)


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.