Build a Linux QT Development Environment

Source: Internet
Author: User

For more information, see http://www.doc88.com/p-59138565158.htmland QT doc.

First download the source code
Qt-creator-2.4.1-src.tar.gz graphics Development Environment
Qt-everywhere-opensource-src-4.8.0.tar.gz QT source code, compiled into QT library and qmake

Decompress the package to the system.
All QT-related files of mkdir/usr/local/QT are defined in this directory for ease of management.
Tar xvf qt-everywhere-opensource-src-4.8.0.tar.gz-C/usr/local/QT/
Tar xvf qt-creator-2.4.1-src.tar.gz-C/usr/local/QT/

Create a directory
Mkdir/usr/local/QT
Mkdir/usr/local/QT/qt_x11: Compile the library path for running the QT program on the PC.
Mkdir/usr/local/QT/qt_embeded_x86 compile the library path for simulating qvfb running QT program on PC
Mkdir/usr/local/QT/qt_arm
Mkdir/usr/local/QT/qvfb
Mkdir/usr/local/QT/Shell stores the shell script directory for setting the library Environment Variables

To install the Lib required by QT, see: Doc \ HTML \ requirements-x11.html to compile the lib on which X11 depends

1. Set up the PC version, that is, X11 installation. You can refer to the file in the source code.
/Doc/html/requirements-x11.html install X11 before the library to install, QT dependency
/Doc/html/install-x11.html install QT Method

A) Qt library Compilation
CD/usr/local/QT/qt-everywhere-opensource-src-4.8.0
./Configure-Prefix/usr/local/QT/qt_x11
Make
Make install

B) Qt LIBRARY PATH settings
CD/usr/local/QT/Shell
Touch setenv_qt_x11.sh
Vim setenv_qt_x11.sh
Add the following in setenv_qt_x11.sh:
##########################

Qtdir =/usr/local/QT/qt_x11
Path = $ path: $ qtdir/bin
Manpath = $ manpath: $ qtdir/doc/man
LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: $ qtdir/lib
Export qtdir path manpath LD_LIBRARY_PATH

##########################

2. x86 version (required when running QT qvfb)
A) Qt library Compilation
CD/usr/local/QT/qt-everywhere-opensource-src-4.8.0
./Configure-Prefix/usr/local/QT/qt_embeded_x86-embedded x86-qvfb (-qvbf indicates compiling virtual framebuffer, which is used by the simulator)
Make
Make install

B) Qt LIBRARY PATH settings
CD/usr/local/QT/Shell
Touch setenv_qt_embeded_x86.sh
Vim setenv_qt_embeded_x86.sh
Add the following in setenv_qt_embeded_x86.sh:
##########################

Qtdir =/usr/local/QT/qt_embeded_x86
Path = $ path: $ qtdir/bin
Manpath = $ manpath: $ qtdir/doc/man
LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: $ qtdir/lib
Export qtdir path manpath LD_LIBRARY_PATH

##########################

3. Embedded ARM QT
A) Qt library Compilation
CD/usr/local/QT/qt-everywhere-opensource-src-4.8.0
./Configure-Prefix/usr/local/QT/qt_arm-Embedded ARM
Make
Make install

B) Qt LIBRARY PATH settings
CD/usr/local/QT/Shell
Touch setenv_qt_arm.sh
Vim setenv_qt_arm.sh
Add the following in setenv_qt_arm.sh:
##########################

Qtdir =/usr/local/QT/qt_arm
Path = $ path: $ qtdir/bin
Manpath = $ manpath: $ qtdir/doc/man
LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: $ qtdir/lib
Export qtdir path manpath LD_LIBRARY_PATH

##########################

4. Compile the qvfb Tool
A) qvfb Compilation
CD/usr/local/QT/qt-everywhere-opensource-src-4.8.0
CD./tools/qvfb
Make
CP.../bin/qvfb/usr/local/QT/qvfb
Otherwise:
CD // usr/local/QT/qt-everywhere-opensource-src-4.8.0/src/plugins/gfxdrivers/qvfb
Qmake
Make install

5. Run the QT program on the PC:
Write code
Qmake-Project generation. Pro
Qmake
Make

6. the QT Program specifies the installation path.
Add the following in the. Pro file:
Target. Path =/usr/local/MyApp
Target. Files = *. cpp qtdemo
UNIX: target. Extra = LS & Echo 1
Instballs + = Target

7. ubutu directly sudo apt-Get install libqt4-dev directly install QT library, and then set the environment variables on OK

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.