Building the Qt 4 development environment

Source: Internet
Author: User
Tags versions
To participate in the internship, need to use QT, the first use of Qt 5.7, and later because of the understanding of Qt 4.x and Qt 5.x there is a big difference, and in the attempt to transplant the process is not very smooth, simply recompile the installation of Qt 4, on the Internet to view a lot of various tutorials, But more or less have encountered some problems, here, the installation process to record their own, one is to comb their own construction of the entire environment process, and secondly for the needs of the reference.

Host Environment: Ubuntu 14.04 (64-bit)

First is the download, because I installed QT has been updated to 5.7, to install QT 4.x, you need to the official download directory under the archive for the old versions link, here directly to my download qt 4.8.6 download link

http://download.qt.io/archive/qt/4.8/4.8.6/

All I've chosen is qt-everywhere-opensource-src-4.8.6.tar.gz.

When you are done, unzip it using the following command:

TAR-ZXVF qt-everywhere-opensource-src-4.8.6.tar.gz

Pre-installation preparation, installation of g++ and three important packages, commands are as follows:
sudo apt-get install g++
sudo apt-get install Libx11-dev libxext-dev Libxtst-dev

Then, go to the unpacked package: qt-everywhere-opensource-src-4.8.6, execute the command
./configure
Then select the open source version and choose to accept the relevant agreement.
Wait, the following message should appear,

Qt is now configured-building, just run ' make '
Once everything are built, you must run ' make install '

Follow the instructions above to first enter:

Make

After the compilation is complete, you need to execute the command as root, then enter

sudo make install
The installation path for Qt should be/usr/local/trolltech/qt-4.8.6, enter the Bin folder under this directory and execute the following command:

Qmake-v
If the installation is successful, the version information should appear, but my installation shows the following error at the beginning:

Qmake:could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake ': No such file or directory

Workaround, install QT-SDK, instructions as follows:

sudo apt-get install QT-SDK
Then the correct version information appears when you execute the QMake command: QMake versions 3.0

Next, you need to configure the environment variable, the profile of the root identity edit directory/etc

sudo gedit/ect/profile

Add the following statement at the end of the profile

Export qtdir=/usr/local/trolltech/qt-4.8.6
export path= $QTDIR/bin: $PATH
export manpath= $QTDIR/man:$ MANPATH
Export ld_library_path= $QTDIR/lib: $LD _library_path
After saving, exit, and then restart your computer. After rebooting, enter in any path: QMAKE-V will have version information displayed.


Final installation of Qt Creator

Download qt Creator directly on the QT website, i downloaded QT Creator 4.0.3 for Linux 64-bit (in MB), after the download is complete, give the file executable permissions

Hmod u+x Qt-creator-opensource-linux-x86_64-4.0.3.run
Then, run this file in the same directory as the file
./qt-creator-opensource-linux-x86_64-4.0.3.run
The entire installation process is similar to installing under Windows.

This completes the QT 4 environment.

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.