Thursday, December 25, 2008

Installing Qt SDK 4.6.2 on Ubuntu/Linux

To install the latest Qt SDK 4.6.2 on Ubuntu/Linux, follow these steps. For this example I'm using Ubuntu 10.04 Lucid Lynx.
  1. Download the Qt Development Environment. Install the
  2. Install additional development libraries:
  3. sudo apt-get install libglib2.0-dev libSM-dev libxrender-dev libfontconfig1-dev libxext-dev libgl-dev libglu-dev
      4.  Setup is ready to build qt libraries.


Install Qt 4.4.1 on linux

# for Qt, there is no "make install", just place the source
# where you want it to live:
cd /usr/local
tar -xvzf qt-x11-4.4.1.tar.gz
ln -s qt-4.4.1 qt
cd qt


Read the INSTALL file about environment variables to setup before you try to build Qt. You can add the following to /home/user/.bashrc or /root/.bashrc after the build.

QTDIR=/usr/local/Trolltech/Qt4.x.y/

export PATH=$PATH:$QTDIR/bin

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QTDIR/lib

export QMAKESPEC=$QMAKESPEC:$QTDIR/include

Steps to compile Qt from Sources
------------------------------------------------------
Qt sources compilation dependencies in Ubuntu Natty 11.xy+
1.Download the QtSources from http://qt.nokia.com/downloads.


a)If this is the error in the terminal
Basic XLib functionality test failed! You might need to modify the include and library search paths by editing
QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /home/jaladisat/Downloads/QtSrc/qt-everywhere-opensource-src-4.7.4/mkspecs/linux-g++.

Solution)Install libxext-dev package,below is the necessary command

sudo apt-get install libxext-dev

b)If this is the error in the terminal you need to install Xrender package.

/usr/bin/ld: cannot find -lXrender
Solution) Install libxrender-dev - X Rendering Extension client library(development  files),below is the necessary command

sudo apt-get install libXrender-dev