Porting ubuntu10.10 to QT 4.6.3 in Linux (20

Source: Internet
Author: User

1. Transplant preparation

1.1 environment and resources required for compilation

1, QT source package: qt4.6 source package: qt-everywhere-opensource-src-4.6.3.tar.gz

2. Cross-compilation tool: arm-linux-gcc-4.4.3-20100728.tar

3, touch screen verification tool: tslib-1.4.tar.gz

4. OS environment running on PC: ubuntu10.10

5. mini2440 Development Board

1.2 install the Cross Compiler

Put the cross-compilation toolkit in the root directory and execute the following command:

  1. Tar zxvf arm-linux-gcc-4.4.3-20100728.tar-C/

Decompress the package and generate a directory:/opt/friendlyarm/toolschain/4.4.3. Enter the directory, enter the bin directory, and run the following command:

  1. PWD>/root/. bashrc

Run the following command:

  1. VI/root/. bashrc

Then modify the last line: Export Path =/opt/friendlyarm/toolschain/4.4.3/bin: $ path

To make the configuration environment take effect immediately, run the following command:

  1. Source/root/. bashrc

View the version information and run the following command:

  1. Arm-Linux-gcc-V

If the correct version is displayed, the cross compiler is successfully configured.

1.3 install touch screen verification tools

Put tslib-1.4.tar.gz in a directory, for example,/OPT. Run the following command:

  1. Tar zxvf tslib-1.4.tar.gz

Run the CD tslib command to enter the current directory of tslib. Then run the following command:

  1. Source autogen. Sh

Then run the configuration command:

  1. ./Configure -- prefix =/usr/local/tslib -- Host = arm-linuxac_cv_func_malloc_0_nonnull = Yes

Finally, execute the compilation command and installation command as follows:

  1. Make
  2. Make install

If the above steps are correct, we can see the library files we need under/usr/local/tslib, which will be used for porting.

1.4 compile the Qt-4.6.3 Library File

Put qt-everywhere-opensource-src-4.6.3.tar.gz in the/OPT directory. Run the following command:

  1. Tar zxvf qt-everywhere-opensource-src-4.6.3.tar.gz

Then decompress the Directory into a qt-embeded-4.6.3-arm, execute the command as follows:

  1. MV qt-everywhere-opensource-src-4.6.3.tar.gz qt-embedded-4.6.3-arm

Go to the qt-embedded-4.6.3-arm and run the configuration command as follows:

  1. ./Configure-Prefix/usr/local/trolltech/QtEmbedded-4.6.3-arm-opensource-confirm-license-release-shared-Embedded ARM-xplatform
  2. Qws/Linux-arm-G ++-Depths 16,18, 24-fast-optimized-qmake-PCH-QT-SQL-SQLite-QT-libjpeg-QT-zlib-QT-libpng-QT-FreeType
  3. -Little-Endian-host-little-Endian-no-qt3support-no-LibTIFF-no-libmng-no-OpenGL-no-MMX-no-SSE-no-sse2-no-3dnow-no-WebKit
  4. -No-qvfb-no-phonon-no-Nis-no-OpenGL-no-cups-no-glib-no-xcursor-no-xfixes-no-xrandroid-no-xrender -No-separate-debug-Info
  5. -Nomake examples-nomake tools-nomake docs-QT-mouse-tslib-I/usr/local/tslib/include-L/usr/local/tslib/lib

Run the following command to continue the compilation and installation:

  1. Make
  2. Make install

If the above is successful, you will see the QT library file based on the arm processing platform under the directory/usr/local/trolltech/QtEmbedded-4.6.3-arm.

2. Start porting

2.1 port the Library to the mini2440 Development Board

Create a directory on the Development Board as follows:

  1. /Usr/local/trolltech/QtEmbedded-4.6.3-arm/bin.
  2. // Usr/local/trolltech/QtEmbedded-4.6.3-arm/lib/Fonts
  3. /Usr/local/tslib

Copy the required Runtime Library

Copy all files under/usr/local/trolltech/QtEmbedded-4.6.3/lib/compiled on PC to/usr/local/trolltech/QtEmbedded-4.6.3-arm/lib/

Copy touch screen Software

Copy all the files in the/usr/local/tslib/directory compiled and installed on the PC to the Development Board/usr/local/tslib.

2.2 create environment variables at mini2440

Run the following command: VI/etc/profile:

  1. Export qtdir =/usr/local/trolltech/QtEmbedded-4.6.3-arm
  2. Export qpedir =/usr/local/trolltech/QtEmbedded-4.6.3-arm
  3. Export tslib_root =/usr/local/tslib
  4. Export Path = $ qtdir/bin: $ path
  5. Export tslib_consoledevice = none
  6. Export tslib_fbdevice =/dev/fb0
  7. Export tslib_tsdevice =/dev/input/event0
  8. Export tslib_plugindir = $ tslib_root/lib/TS
  9. Export tslib_conffile = $ tslib_root/etc/ts. conf
  10. Export tslib_calibfile =/etc/pointercal
  11. Export qws_mouse_proto = tslib:/dev/input/event0
  12. Export qws_display = linuxfb:/dev/fb0
  13. Export qws_size = 240x320
  14. Export LD_LIBRARY_PATH = $ tslib_root/lib: $ qtdir/lib:/usr/local/lib: $ LD_LIBRARY_PATH

Modify the/usr/local/tslib/etc/ts. conf file on mini2440: remove the # And space before # module_raw input in the second line, save and exit.

2.3 porting implementation

First, compile on the PC, enter the program (test_hello) directory, and then execute the following command:

  1. // Usr/local/trolltech/QtEmbedded-4.6.3-arm/bin/qmake

Then execute the compile command: Make

After execution, run the following command: whether file test_hello is a binary file. If yes, it indicates that the compilation is successful and can be transplanted to the mini2440 Development Board.

Copy the compiled program test_hello to the development board/usr/local/trolltech/QtEmbedded-4.6.3-arm/bin/directory through the USB flash drive.

Then run./test_hello-qws-fonts wenquanyi on the terminal. If your program appears on the Development Board, the execution is successful.

After practical experiments, it is confirmed that the cross compiler should use the cross compiler tool: arm-linux-gcc-4.4.3-20100728.tar

If version 4.3.2 is used, the cause of the error is always unknown.

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.