Build and port the embedded development environment of QT 4.6.0 in Linux from the blog of Zixia

Source: Internet
Author: User

Qt: qt-everywhere-opensource-src-4.6.0.tar.gz
Embed platform: 2440
Arm-Linux-GCC: 4.1.2, download (when I use 4.3.2 and 4.4.1, there is a segment error during porting. I put it in:/Usr/local/ARM/4.1.2/.)

Convert QT-Everywhere-Decompress the opensource-src-4.6.0.tar.gz package in three copies to compile PC, embedded x86, and arm versions.

1. Compile the PC version:
$./Configure
$ Make
# Make install

2. Compile the embedded x86 version:
$./Configure-embedded x86-QT-GFX-qvfb-QT-KBD-qvfb-QT-mouse-qvfb
$ Make
# Make install

Compile and install qvfb in PC:
$ CD ***/qt-everywhere-opensource-src-4.6.0/tools/qvfb
$ Make
# Cp ****/qt-everywhere-opensource-src-4.6.0/bin/qvfb/usr/local/trolltech/QtEmbedded-4.6.0/bin

3. Compile the Embedded ARM version (support for ARM-Linux-GCC is required ):

Compile tslib to support touch screen:
Download tslib1.4.tar.gz. After decompression:
$./Configure -- prefix =/Usr/local/tslib/-- Host = arm-Linux ac_cv_func_malloc_0_nonnull = Yes
$ Make
# Make install

set environment variables so that relevant libraries can be found during compilation:
$ export cplus_include_path = /usr/local/ARM/4.1.2/ arm-Angstrom-Linux-gnueabi/include/C ++: /usr/local/ARM/4.1.2/ arm-Angstrom-Linux-gnueabi/include/C ++/ARM-Angstrom-Linux-gnueabi

Configuration:
$./Configure/
-Opensource/
-Confirm-license/
-Release-shared/
-Embedded ARM/
-Xplatform qws/Linux-arm-G ++/
-Depths 16, 18, 24/
-Fast/
-Optimized-qmake/
-PCH/
-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-OpenGL/
-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

Configuration result:
Debug ...... No
Qt 3 compatibility... no
Qtw.module... no
Qtconcurrent code... yes
Qtscript module... yes
Qtscripttools module Yes
Qtxmlpatterns module No
Phonon module... no
Multimedia module... yes
SVG module... yes
WebKit module... no
Declarative module... no
STL support... no
PCH support... yes
MMX/3 dnow/SSE/sse2.. no/No
Iwmmxt support... no
IPv6 support... yes
IPv6 ifname support. Yes
Getaddrinfo support. Yes
Getifaddrs support .. Yes
Accessibility... yes
NIS support... no
Cups support... no
Iconv support... no
Glib support... no
Gstreamer support... auto
Large file support .. Yes
GIF support ...... plugin
Tiff support... no
JPEG support ...... plugin (QT)
PNG support ...... Yes (QT)
MNG support... no
Zlib support... yes
Session management... no
Embedded support... arm
FreeType2 support... yes
Graphics (QT) ...... linuxfb multismultiscreen
Graphics (plugin )...
Decorations (QT)... styled Windows Default
Decorations (plugin)
Keyboard driver (QT). tty
Keyboard driver (plugin)
Mouse driver (QT)... PC linuxtp tslib
Mouse driver (plugin)
OpenGL support... no
Openvg support... no
SQLite support... QT (QT)
OpenSSL support... no
ALSA support... yes

Compile: $ make

If an error occurs:
/Usr/local/ARM/4.1.2/bin /.. /lib/GCC/ARM-Angstrom-Linux-gnueabi/4.1.2 /.. /.. /.. /.. /ARM-Angstrom-Linux-gnueabi/bin/ld: Warning: libts-0.0.so.0, needed by/home/Stillwater/4.1.2/qt-everywhere-opensource-src-4.6.0/lib/libqtgui. so, not found (try using-rpath or-rpath-link)
/Home/Stillwater/4.1.2/qt-everywhere-opensource-src-4.6.0/lib/libqtgui. So: Undefined reference to 'ts _ read_raw'
/Home/Stillwater/4.1.2/qt-everywhere-opensource-src-4.6.0/lib/libqtgui. So: Undefined reference to 'ts _ open'
/Home/Stillwater/4.1.2/qt-everywhere-opensource-src-4.6.0/lib/libqtgui. So: Undefined reference to 'ts _ fs'
/Home/Stillwater/4.1.2/qt-everywhere-opensource-src-4.6.0/lib/libqtgui. So: Undefined reference to 'ts _ config'
/Home/Stillwater/4.1.2/qt-everywhere-opensource-src-4.6.0/lib/libqtgui. So: Undefined reference to 'ts _ close'
/Home/Stillwater/4.1.2/qt-everywhere-opensource-src-4.6.0/lib/libqtgui. So: Undefined reference to 'ts _ read'
Collect2: LD returned 1 exit status
Make [2]: *** [deform] Error 1
Make [2]: Leaving directory '/home/Stillwater/4.1.2/qt-everywhere-opensource-src-4.6.0/demos/deform'
Make [1]: *** [sub-deform-make_default] Error 2
Make [1]: Leaving directory '/home/Stillwater/4.1.2/qt-everywhere-opensource-src-4.6.0/demos'
Make: *** [sub-demos-make_default-ordered] Error 2

Solution:
Modify the qt-everywhere-opensource-src-4.6.0/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

Reference: http: // 74.125.153.132/search? Q = cache: 3wzcjer1274sj: pushed

Add environment variable: # export Path =/usr/local/ARM/4.1.2/bin: $ path

Install: # make install-strip

After installation is complete, there are three folders in the/usr/local/trolltech Directory: Qt-4.6.0, QtEmbedded-4.6.0, QtEmbedded-4.6.0-arm.

Test embedded x86:
$ Source ~ /. Setenv-qt-x86.sh
$ Qvfb-Width 800-height 600 &
$/Usr/local/trolltech/QtEmbedded-4.6.0/demos/books-qws

4. Compile the environment variable setting file (to facilitate switching between different environments ):

PC ~ /. Add the following to bashrc:
Export Path = $ path:/usr/local/ARM/4.1.2/bin

~ /. Setenv-qt-x11.sh (corresponding to pc qt ):
Path =/usr/local/trolltech/Qt-4.6.0/bin: $ path
LD_LIBRARY_PATH =/usr/local/trolltech/Qt-4.6.0/lib: $ LD_LIBRARY_PATH
Cplus_include_path =

~ /. Setenv-qt-x86.sh:
Qtedir =/usr/local/trolltech/QtEmbedded-4.6.0
Path =/usr/local/trolltech/QtEmbedded-4.6.0/bin: $ path
LD_LIBRARY_PATH =/usr/local/trolltech/QtEmbedded-4.6.0/lib: $ LD_LIBRARY_PATH

~ /. Setenv-qt-arm.sh:
Qtedir =/usr/local/trolltech/QtEmbedded-4.6.0-arm
Path =/usr/local/trolltech/QtEmbedded-4.6.0-arm/bin: $ path
LD_LIBRARY_PATH =/usr/local/trolltech/QtEmbedded-4.6.0-arm/lib: $ LD_LIBRARY_PATH
Cplus_include_path =/usr/local/ARM/4.1.2/ARM-Angstrom-Linux-gnueabi/include/C ++: /usr/local/ARM/4.1.2/ARM-Angstrom-Linux-gnueabi/include/C ++/ARM-Angstrom-Linux-gnueabi: $ cplus_include_path

5. Porting
Copy the libraries in/usr/local/trolltech/QtEmbedded-4.6.0-arm/lib on the PC to/usr/local/trolltech/QtEmbedded-4.6.0-arm/lib of 2440 (corresponding directory replication ).

Copy the databases in/usr/local/tslib on the PC to the/usr/local directory of 2440.

If other libraries are missing at runtime, the replication method is the same.

To support touch screen, set environment variables automatically at startup and add the following values to/etc/profile of 2440:
Export LD_LIBRARY_PATH =/usr/local/lib: $ qtdir/lib: $ LD_LIBRARY_PATH
Export tslib_root =/usr/local/lib
Export tslib_tsdevice =/dev/input/event0
Export tslib_fbdevice =/dev/fb0
Export tslib_plugindir =/usr/local/lib/TS
Export tslib_consoledevice = none
Export tslib_conffile =/usr/local/etc/ts. conf
Export pointercal_file =/etc/pointercal
Export tslib_calibfile =/etc/pointercal
Export qws_mouse_proto = tslib:/dev/input/event0

Note: You can use $ CAT/dev/input/event0 to test the touch screen.

Cancel the first comment in/usr/local/etc/ts. conf:
# Module_raw input (remove # and the top of the line)

Run/usr/local/bin/ts_calibrate calibration touch screen.

6,ProgramCompile:
PC:
$ Make distclean
$ Source ~ /. Setenv-qt-x11.sh
$ Qmake
$ Make

Arm version:
$ Make distclean
$ Source ~ /. Setenv-qt-arm.sh
$ Qmake
$ Make

Refer:
Http://blog.ednchina.com/gurongjiang/352778/Message.aspx

Related Article

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.