Install QtEmbedded4.4.0 on the Redhat9 text System

Source: Internet
Author: User
QtEmbedded is directly dependent on Framebuffer and does not require X-Window. Therefore, you must enable Framebuffer for Linux. To enable this function, use BootLoader to pass parameters to the kernel: for grub, add vga = 0x311fb: on after the kernel command in the grub. conf file. For lilo, add vga = 0x311 to the lilo. conf file. 0x311 indicates the resolution is 640*480,

Qt Embedded is directly dependent on Framebuffer and does not require X-Window. Therefore, you must enable Framebuffer for Linux. You can use BootLoader to pass parameters to the kernel:

For grub, add vga = 0x311 fb: on after the kernel command in the grub. conf file.

For lilo, add vga = 0x311 to the lilo. conf file.

0x311 indicates that the resolution is 640*480 and 16dpp.

Compile and install

First download the Qt/E-4.4.0 source code, and then decompress in the root directory:

Cd/root

Tar-xvjf qt-embedded-linux-opensource-src-4.4.0.tar.bz2

Cd qt-embedded-linux-opensource-src-4.4.0

The source code contains documents and routines. These will occupy a lot of space and compilation time. If you don't need it, modify configure and remove it:

Change QT_DEFAULT_BUILD_PARTS = "libs tools examples demos doc"

QT_DEFAULT_BUILD_PARTS = "libs tools"

You can use the configure option to disable many unnecessary modules. Use./configure-help to view details.

For the embedded version, you can also use-no-feature- Disable the corresponding features. By default, all features are compiled. The available feature is described in the src/corelib/global/qfeatures.txt file. However, this method is inconvenient. Generally, a configuration file is specified through the-qconfig parameter. There are several typical configuration files in the src/corelib/global/directory:

Qconfig-large.h # contains most of the features.

Qconfig-small.h # closes many features.

Qconfig-minimal.h # minimal configuration, close almost all features.

You can manually edit and modify the configuration. However, dependencies between various features are complex. All Qt provides a graphical tool qconfig to help generate configurations. This tool needs to be compiled. Install Qt/E before introducing it.

Run:

. /Configure-prefix/usr/qt-release-no-largefile-no-qt3support-no-xmlpatterns-no-phonon-no-svg-no-webkit-no-mmx-no-3dnow-no -sse-no-sse2-no-gif-no-libtiff-no-libmng-qt-libpng-qt-libjpeg-no-openssl-no-nis-no-cups-no-iconv -no-opengl-no-embedded-qt-freetype-depths 16-embedded x86-qt-decoration-default-qt-gfx-linuxfb-qt-kbd-tty-qt-kbd -usb-qt-mouse-pc-qt-mouse-bus-no-glib-qconfig src/corelib/global/qconfig-small.h

Make

Make install

It takes several hours to compile the project. All files will be installed in the/usr/qt/directory. Www.linuxidc.com:

Add the following content to the/etc/profile file:

PATH = $ PATH:/usr/qt/bin

Add the following content to the/etc/ld. so. conf file:

/Usr/qt/lib

Then run ldconf-v

After the system is restarted, Qt/E can be used.

Test

  1. // Demo. cpp
  2. # Include
  3. # Include
  4. # Include
  5. # Include
  6.  IntMain (IntArgc,Char* Argv [])
  7. {
  8. QApplication app (argc, argv );
  9. QTextCodec * codec = QTextCodec: codecForName ("GB18030");
  10. QTextCodec: setCodecForLocale (codec );
  11. QTextCodec: setCodecForCStrings (codec );
  12. QTextCodec: setCodecForTr (codec );
  13. QPushButton hello ("Hello world! ");
  14. Hello. show ();
  15. ReturnApp.exe c ();
  16. }

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.