Turn: Qt Embedded development environment Construction

Source: Internet
Author: User

Address: http://www.cnblogs.com/lishixian/articles/3013897.html lsx_007

Here is the main record of their own embedded development environment to read some of the valuable reference documents, the document is mainly from the network, because it is downloaded from the library, so do not know where the document? Because the personal feel that the summary is better, I take it for the record, of course, on this basis will also add my own understanding! This article is mainly organized in the form of questions and answers.

QT Embedded development environment is the content of this article, we first look at the various versions of QT Introduction:

1. What is QT

Qt is a complete framework for C + + application development. It contains a class library, and tools for cross-platform development and internationalization. The QT API is the same on all supported platforms, and the QT tools are used consistently on these platforms, so the development and deployment of QT applications is platform agnostic.

2. What is Qtopia

Qtopia is a full-fledged application development platform for Embedded Linux, as well as a user interface for Linux-based PDAs (personal digital assistants), Smartphones (Smartphone), and other mobile devices. To put it simply, Qtopia is essentially a set of applications for PDAs and smartphones that, if needed, could quickly build a PDA or smart phone based on this set of programs. Qtopia essentially relies on qt/embedded.

3. What is qt/embedded

Qt/embedded is a complete self-contained GUI and Linux-based embedded platform development tool. The name of the development tool seems to be the most confusing, of course qt/embedded is the most familiar name, as if Qtopia Core said it. Recently, the company changed its name, its new name is called Qt-embedded-linux-xxxx, it seems that the qt/embedded vest is still many ha.

here is the QT development platform, my platform is Fedora 15, the need for QT version has two :

12 qt-x11-opensource-src-4.3.2.tar.gz  qt-embedded-linux-opensource-src-4.4.0-rc1.tar.bz2

qt-x11 version can produce QT development tools, such as designer and so on, the most important thing is to get QVFB, embedded development has QVFB, you can not need the actual development Board, you can also develop QT program. The qt-embedded version is specifically intended for use in embedded areas. Here are the installation steps :

1. Unzip the two QT packages

1234 tar –jxvf qt-x11-opensource-src-4.3.2.tar.gz  tar –jxvf qt-embedded-linux-opensource-src-4.4.0-rc1.tar.bz2  cp qt-embedded-linux-opensource-src-4.4.0-rc1 qt-embedded-linux-opensource-src-4.4.0-rc1-x86  mv qt-embedded-linux-opensource-src-4.4.0-rc1 qt-embedded-linux-opensource-src-4.4.0-rc1-arm

here, Qt-embedded has two copies: Qt-embedded-linux-opensource-src-4.4.0-rc1-x86 and Qt-embedded-linux-opensource-src-4.4.0-rc1-arm, according to their name can know the former is suitable for the X architecture, the latter is suitable for the ARM architecture why need two? If there is a development board, you can only compile qt-embedded version of the ARM architecture can be, but many times with qvfb words, development will be much easier, so it is also good to compile a x86 architecture.

Whether there are some doubts, qt-x11 is also suitable for x86 structure, this is not and qt-embedded repeat it? The answer is this, theqt-embedded version can only run on the embedded board, compiled into the x86 architecture program can only run on the x86 embedded board. As we said earlier, we need QVFB to develop, but QVFB can only execute x86 schema applications, so qt-embedded will need to generate libraries and other files about x86.

And what about compiling qt-embedded into arm? The reason is simple, my final QT application needs to run on the arm architecture, of course, need this library, so it is logical to compile into arm. OK, now simply summarize, first of all, using the library and development tools provided by qt-x11 to develop QT applications, and then use qt-embedded about x86 libraries and tools to compile our QT application again, this is the resulting executable can be run on QVFB, and finally, Using Qt-embeddedd's arm library to compile again can get executable programs that can run on arm.

Obviously, if there is a development Board, the second step is to be able to do not (preferably), if there is no Development board, the third step is not necessary, so that you do not need to compile the qt-embedded into a suitable arm architecture.

Specific steps and instructions:

1. Download the source package

12 qt-x11-opensource-src-4.5.0.tar.bz2  qt-embedded-linux-opensource-src-4.5.0.tar.bz2

: ftp://ftp.qtsoftware.com/qt/source/

2. Compiling and installing qt-x11-opensource-src-4.5.0

QT-X11 version can produce QT development tools, such as designer and so on, the most important thing is to get QVFB, embedded development has QVFB, you can not need the actual development Board, you can also develop QT program. The qt-embedded version is specifically intended for use in embedded areas.

12345 tar xjvf qt-x11-opensource-src-4.5.0.tar.bz2  cd qt-x11-opensource-src-4.5.0  ./configure  make  make install

After a lengthy compilation process, it is installed under/usr/local/trolltech/qt-4.5.0 by default for about 1.5 hours. The source program does not delete after compiling, also useful

3. Compiling and installing qt-embedded-linux-opensource-src-4.5.0

Create a src directory under the user directory to hold the compiled source file qt-embedded-linux-opensource-src-4.5.0.tar.bz2. Unzip it to get qt-embedded-linux-opensource-src-4.5.0 and rename it to qt-embedded-linux-opensource-src-4.5.0-x86. Unzip qt-embedded-linux-opensource-src-4.5.0.tar.bz2 again, and command for qt-embedded- Linux-opensource-src-4.5.0-arm. Why are there two copies? We can see from their names that the former is suitable for the X architecture, the latter is suitable for the ARM architecture, if there is a development board, you can only compile qt-embedded version of the ARM architecture can be, but many times with qvfb words, development will be more convenient, so it is also good to compile a x86 architecture.

12345678910 mkdir ~/src  mv qt-embedded-linux-opensource-src-4.5.0.tar.bz2 ~/src  tar xjvf qt-embedded-linux-opensource-src-4.5.0.tar.bz2  mv qt-embedded-linux-opensource-src-4.5.0 qt-embedded-linux-opensource-src-4.5.0-x86  tar xjvf qt-embedded-linux-opensource-src-4.5.0.tar.bz2  mv qt-embedded-linux-opensource-src-4.5.0 qt-embedded-linux-opensource-src-4.5.0-arm  cd qt-embedded-linux-opensource-src-4.5.0-x86  ./configure- prefix/usr/local/trolltech/qtembedded-4.5.0-x86-embedded x86-qvfb  make   make install

Ok! Qt-embedded-x86 is installed under/usr/local/trolltech/qtembedded-4.5.0-x86!!!

1234 cd qt-embedded-linux-opensource-src-4.5.0-arm  ./configure -prefix /usr/local/Trolltech/QtEmbedded-4.5.0-arm -embedded arm  make  make install

Ok!qt-embedded-arm is installed under the/usr/local/trolltech/qtembedded-4.5.0-arm!!!

4. We have now installed the version of Qt-x11, which is the version of Qt,qt-embedded-x86 running on the PC (QT running on the embedded board of the x86 system) and Qt-embedded-arm (Qt running on the arm board). Next: Set Environment variables

4.1 qt-x11:

1 vi setenv.sh

Add the following content:

12 PATH=/usr/local/Trolltech/Qt-4.5.0/bin:$PATH  LD_LIBRARY_PATH=/usr/local/Trolltech/Qt-4.5.0/lib:$LD_LIBRARY_PATH

Save exit. Move to/usr/local/trolltech/qt-4.5.0

4.2 Qt-embedded-x86:

1 vi setenv.sh

Add the following content:

123 QTEDIR=/usr/local/Trolltech/QtEmbedded-4.5.0-x86  PATH=/usr/local/Trolltech/QtEmbedded-4.5.0-x86/bin:$PATH  LD_LIBRARY_PATH=/usr/local/Trolltech/QtEmbedded-4.5.0-x86/lib:$LD_LIBRARY_PATH

Save exit. Move to/usr/local/trolltech/qtembedded-4.5.0-x86

4.3 qt-embedded-arm:

1 vi setenv.sh

Add the following content:

123 QTEDIR=/usr/local/Trolltech/QtEmbedded-4.5.0-arm  PATH=/usr/local/Trolltech/QtEmbedded-4.5.0-arm/bin:$PATH  LD_LIBRARY_PATH=/usr/local/Trolltech/QtEmbedded-4.5.0-arm/lib:$LD_LIBRARY_PATH

Save exit. Move to/usr/local/trolltech/qtembedded-4.5.0-arm

We run the corresponding script at runtime, for example, we want to use qt-x11:

12 cd /usr/local/Trolltech/Qt-4.5.0  source setenv.sh

And then you can use tools like Qmake Designer.

5. Do this step and qvfb not compile, to qt-x11-opensource-src-4.5.0 recompile QVFB can be

12 cd qt-x11-opensource-src-4.5.0  cd /tools/qvfb

Make-generates QVFB under Qt-x11-opensource-src-4.5.0/bin, we copy it to/usr/local/trolltech/qtembedded-4.5.0-x86/bin

1 cp ../..bin/qvfb /usr/local/Trolltech/QtEmbedded-4.5.0-x86/bin

6. Do a test

12345 cd /usr/local/Trolltech/QtEmbedded-4.5.0-x86  source setenv.sh  cd /usr/local/Trolltech/QtEmbedded-4.5.0-x86/demos/books  qvfb -width 640 -height 480 &  ./books -qws

The error message is typically

1 Error opening buffer device /dev/fb0QScreenLinuxFb::connect: No such file or directory

Most of this happens when you compile the x86 version of qt-embedded , and you want to run the app on QVFB

Users in

First step after running QVFB

The second step runs./myapp-qws

The above prompt error occurs

The reason is qt-embedded when looking for the system display device, the default is to look for LINUXFB, also known as the Linux/dev/fb0 device, but if qt-embedded installed other display devices, such as QVFB, Can be displayed on QVFB, but requires a plug-in (or driver, which may be confused with the device driver), enabling qt-embedded to use QVFB. To do this, you need to add the following options to the Configure command when compiling qt-embedded

1 ./configure -plugin-gfx-qvfb -plugin-kbd-qvfb -plugin-mouse-qvfb 或./configure -qt-gfx-qvfb -qt-kbd-qvfb -qt-mouse-qvfb

If you do not want to recompile qt-embedded, you can also compile the QVFB gfxdrivers separately, with the following command:

12 cd  qt-embedded-linux-opensource-src-4.5.1/src/plugins/gfxdrivers/qvfb/$/usr/local/Trolltech/QtEmbedded-4.5.1/bin/qmake$ sudo make install

corresponding to the path, on everyone's machine may be different, understand the meaning of the line

Summary: About the qt Embedded development environment set up the content of the introduction, I hope this article has helped you!

Turn: Qt Embedded development environment Construction

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.