Qt4.7 Embedded Environment Build source code compilation and installation

Source: Internet
Author: User

First from the official website to download the embedded version of QT, attention to the official network of embedded version and Linux version are 199M, in fact, they are in the official online location is not the same,

Qt libraries 4.7.0 for embedded Linux (199 MB)

Http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.0.tar.gz

Qt Libraries 4.7.0 for linux/x11 (199 MB)

Http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.0.tar.gz

In fact downloading is the same (see their download path are the same),. The downloaded file name is: qt-everywhere-opensource-src-4.7.0.tar.gz

Extract

Tar zxvf qt-everywhere-opensource-src-4.7.0.tar.gz

The extracted files are reproduced two copies (altogether three), respectively named PC; x86; Arm; then start compiling separately:

1. Compiling PC,

CD pc

This step can be an error: 1

This complete error message is in the./configure phase

Basic XLIB functionality Test failed!

You are might need to modify the Include and library search paths by editing

Qmake_incdir_x11 and Qmake_libdir_x11 in/home/zhu/qt/qt-x11-opensource-src-4.5.2/mkspecs/linux-g++

Enter Config.test/x11/xlib execute make command, see error message

g++-wl,-o1-o Xlib XLIB.O-L/USR/X11R6/LIB-LXEXT-LX11-LM

/usr/bin/ld:cannot Find-lxext

Can see, g++ under/usr/x11r6/lib, can't find libxext.so

The reason lies in the need to install LIBX11 development kits, according to their own system characteristics, installation Libx11-dev Libxext-dev Libxtst-dev

Possible error 2:

/usr/bin/ld:cannot Find-lxrender

Description also one less package: Install Libxrender-dev

sudo apt-get install cutecom

sudo apt-get install autoconf automake libtool

Up to now, the last make makes no mistake, but there's good warning, whatever it

sudo make install

2. Compile the embedded x86 version:

Enter x86 directory, set it to QVFB as display output

# sudo./configure-prefix/usr/local/trolltech/qtembedded-4.7.0-embedded x86-qt-gfx-qvfb-qt-kbd-qvfb-qt-mouse-qvfb

# sudo make

# sudo make install

To compile the QVFB in the Install PC version:

Enter pc/tools/qvfb/Directory

#make

#make Install

3. Build ARM version:

Install tslib1.4 First

Download: http://download.csdn.net/source/2803217

After getting the package, cross-compile Tslib

Export Prefix=/usr/local/tslib #设置目标位置

./autogen.sh #用于生成configure脚本

echo "Ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache

#产生一个cache文件arm-linux.cache, cheat Configure,

CC=ARM-LINUX-GCC./configure--host=arm-linux--prefix= $PREFIX--cache-file=arm-linux.cache

Make

Make install

/bin,/etc,/include,/lib 4 folders are generated at the target location after cross success

(When compiling, note that the ARM-LINUX-GCC is not valid under the current shell, it must be export in advance)

QT for Arm:

CD arm

Create a script below:

#vim myconfig.sh

#!/bin/bash

./configure-prefix/usr/local/trolltech/qtembedded-4.7.0-arm-opensource-confirm-license-release-shared-embedded Arm-xplatform qws/linux-arm-g++-depths 16,18,24-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-opengl-no-cups-no-glib-no-xcursor-no-xfixes- No-xrandr-no-xrender-no-separate-debug-info-nomake Examples-nomake Tools-nomake docs-d__arm_arch_5tej__- Qt-mouse-tslib-i/usr/local/gtkdfb/include-l/usr/local/gtkdfb/lib

Select the appropriate content according to the migration needs, execute configure

(-qt-mouse-tslib below is the directory of the tslib1.4 just compiled,-d__arm_arch_5tej__ to solve the problem mentioned below)

#source myconfig.sh

Compile

#make

#make Install

Possible error 1:

{standard input}: Assembler messages:

{standard Input}:778:error:register or shift expression expected--' Orr r3,r2,lsl#16 '

{standard Input}:789:error:register or shift expression expected--' Orr r2,r3,lsl#16 '

{standard Input}:7748:error:register or shift expression expected--' Orr r3,r0,lsl#16 '

{standard Input}:7761:error:register or shift expression expected--' Orr r1,r0,lsl#16 '

MAKE[1]: * * * [. OBJ/RELEASE-SHARED-EMB-ARM/QFONTENGINE_FT.O] Error 1

MAKE[1]: Leaving directory '/home/lijian/qt/build/3.4.1gcc/qt-embedded-4.6.2/src/gui '

Make: * * * [sub-gui-make_default-ordered] Error 2

Scheme:

To the fix this issue patch/src/3rdparty/freetype/include/freetype/config/ftconfig.h line 330.

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

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

PS: All say is the cross compiler version problem, with 4.5.1 just good ... Never tried ...

Possible error 2:

In the file included from./config.h:26,

From.. /JAVASCRIPTCORE/PCRE/PCRE_COMPILE.CPP:44:

.. /javascriptcore/wtf/platform.h:338:6: #error "not supported ARM architecture"

MAKE[1]: * * * [OBJ/RELEASE/PCRE_COMPILE.O] Error 1

MAKE[1]: Leaving directory '/usr/local/qte4.6-arm/src/3rdparty/webkit/webcore '

Make: * * * [sub-webkit-make_default-ordered] Error 2

Scheme:

Add-d__arm_arch_5tej__ or-d__arm_arch_4t to the parameters

or modify Src/3rdparty/webkit/webcore/makefile, add-d__arm_arch_4t__ Modify Src/script/makefile in Cflags, ditto

Possible error 3:

warning:libts-0.0.so.0, needed by, not found (try Using-rpath or-rpath-link)

Undefined reference to ' Ts_read_raw '

Undefined reference to ' Ts_open '

Undefined reference to ' ts_fd '

Undefined reference to ' ts_config '

Undefined reference to ' ts_close '

Undefined reference to ' Ts_read '

Collect2:ld returned 1 exit status

Solution:

Modify the qt-everywhere-opensource-src-4.6.0/mkspecs/qws/linux-arm-g++/qmake.conf file (add 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

There is also a mistake was added-pch parameter caused by the specific error content forgotten.

In addition, it is important to confirm before compiling the ARM-LINUX-GCC environment under the current shell is effective, if the error is best to take a new source code to compile, before it is because there is no change and wasted a lot of time.

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

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.