Saturday, January 5, 2008

Installing Qt on linux

Download Qt's latest version from, I downloaded the source in tar.gz form and compiled it on my machine. It took 1+ hours (Intel 2.4 Ghz. 256Mb RAM running RedHat). It'll jetset on latest machines.
  1. Switch to the directory containing the source and type the following command: tar -zxvf .tar.gz
  2. It will create a directory with extracted contents and tar.gz removed. Change to this directory.
  3. Type the following command: ./configure This checks for the dependencies(i.e other softwares if any, required to install qt).
  4. Then type: gmake. This compiles your qt source code.
  5. Then type: gmake install. This installs qt on your machine.
  6. Note that if you have qt installed on your machine already then to use its latest version you have to set the path of your qt bin file, which you can do by typing the following commands:
export PATH 

For example on my machine after step 5 qt version 4.3.2 was installed in
/usr/local/Trolltech/Qt. Thus I used the following command:
PATH = /usr/local/Trolltech/Qt/bin:$PATH
export PATH
You can also set the PATH variable in your .bash_profile file, but the above method saves you the hassles of editing the file. So take your pick and get on the Qt bandwagon. For any queries regarding installation on the linux box especially redhat contact me on this blog.