You can install Qt in Ubuntu 11.04 in two ways. One is to directly install the qt sdk package, which inherits the QT designer and QT library files. Another method is to download the source code package of QT and then compile and install it.
Method 1
Http://qt.nokia.com/downloads to download the corresponding version, such as linux32-bit.
Method 2
Download the source package, such as the latest http://qt.nokia.com/downloads/linux-x11-cpp
An error occurs during compilation. The solution is to install three packages sudo apt-Get install libX11-dev libxext-dev libxtst-Dev
1) configuration: Enter the decompressed folder and run./configure-Prefix/usr/local/trolltech/Qt-4.7.4-pc
2) Compile: Make (long time, several hours)
3) installation: make install (because the installation directory is specified during configuration, it will be installed under the Directory:/usr/local/trolltech/Qt-4.7.3-pc)
4) then set the QT path, which can be added to home/user/. profile.
Qtdir =/usr/local/trolltech/Qt-4.7.4
Path = $ qtdir/bin: $ path
Manpath = $ qtdir/MAN: $ manpath
LD_LIBRARY_PATH = $ qtdir/lib: $ LD_LIBRARY_PATH
Export qtdir path manpath LD_LIBRARY_PATH
Install others:
Sudo apt-Get install qt4-dev-tools # Development Kit
Sudo apt-Get install qtcreator # ide
Sudo apt-Get install qt4-doc # development help documentation
Sudo apt-Get install qt4-qtconfig # Configuration Tool
Sudo apt-Get install qt4-demos # demo source code