On the QT website http://download.qt.io/archive/
Under the qt4.8.6:http://download.qt.io/archive/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz
and Qt creator 2.5.2:http://download.qt.io/archive/qtcreator/2.5/qt-creator-linux-x86-opensource-2.5.2.bin
- In the terminal, enter the following command in turn:
1 tar xzvf qt-everywhere-opensource-src-4.8. 6 . tar.gz 2 CD qt-everywhere-opensource-src-4.8. 6 3 sudo apt-get install g++4 sudo apt-get install Libx11-dev Libxext-dev libxtst-< C11>dev5 Configuring the QT Library, enter the command:./configure
After the configuration is complete, the following terminal interface is available:
Qt is now configured for building. Just run ' make '. Once Everything is built and you are must run ' make install '. Qt'll is installed into/usr/local/trolltech/qt-4.8.6to reconfigure, run ' make Confclean ' and ' Configure '.
Make to build the QT library and compile all the demo programs
The time here is quite long ...
- To execute the installation command:
- sudo make install
- Qt is installed by default in the/usr/local/trolltech/qt-4.8.6 directory, enter the directory, test
CD/USR/LOCAL/TROLLTECH/QT-4.8.6CD bin./qmake-v
If the correct version information appears, the installation is successful.
My Ubuntu installs a number of qmake, the result of the test is this.
[Linux-devkit]:/media/tl437x/qtcreator-2.6 . 1 /bin> qmake-vqmake version 3.0 using Qt version 5.4 . 1 in /media/tl437x/ti-processor-sdk-linux-am437x-evm-01.00 . 00.03 /linux-devkit/sysroots/cortexa9t2hf-vfp-neon-linux-gnueabi/usr/lib
[Email protected] Virtual-machine:~$ qmake-24.8. 1 in/usr/lib/i386-linux-gnu
[Email protected] Virtual-machine:/usr/local/trolltech/qt-4.8. 6/bin$./qmake-24.8. 6 in/usr/local/trolltech/qt-4.8. 6/lib
Add environment variables (need to be used in any directory to add environment variables)
You first need to set the user environment variables,
Gedit/home/your NAME/.BASHRC
Pop up an edit window, add the following code at the end,
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
Then set the root user environment variables, set the root user's environment variables need root permission, so add sudo,
sudo gedit/etc/profile
Add to:
Export qtdir=/usr/local/trolltech/qt-4.8. 6 export PATH= $QTDIR/bin: $PATH export MANPATH= $QTDIR/man: $MANPATH Export Ld_library_path
After saving the exit, and then restart the computer, in any directory of the terminal input qmake, if the correct information can appear, indicating that the environment variable configuration is successful.
Here, I did not add system variables! , which is added directly below through the Qtcreator tool option.
Installation path:/home/tl/qtcreator-2.5.2
chmod a+x qt-creator-linux-x86-opensource-2.5. 2 . bin
. /qt-creator-linux-x86-opensource-2.5. 2. bin
Open Qtcreator and add qt4.8.6, which is the version you just installed.
Run successfully, the first desktop program.
Ubuntu12.04lts installing QT and QT Creator