Tuesday, October 27, 2009

Installing Qt on My Ubuntu





This week we are assigned to create a simple drawing program using C++, there are different libraries that you can use to develop GUI using C++, any way my friend Abolnour (our open source godfather) advised me to use Qt which is an open source library that enables you to write GUI programs in C++.

The installation process is easy, you have to go to this download page, then choose the LGPL/Free and choose your platform (I chose Linux 32 bit because I am trying to avoid my Vista :D). it's safer and better to dowload the whole SDK whic includes and IDE called Qt-Creator that you can use to create your applications.

After you finish downloading the file (275.4 MB in our case), you will use two lines in the terminal to install every thing.

1 - Navigate to the directory where you downloaded the file using cd

cd /media/disk/Downloads


that's for me (the path will be different for you)

2 - use the command

chmod u+x qt-sdk-linux-x86-opensource-2009.04.1.bin



which makes the file executable.


3 - use the command

./qt-sdk-linux-x86-opensource-2009.04.1.bin


which will run you an installation wizard that asks you where you want to install the Qt-creator
and the libraries.

After that you can use will find the Qt-Creator in the Applications --> Programming, you can use
this tutorial to learn the Qt.

Any way, you may face the silly error I faced when I tried to build a project
the error is
collect2: ld returned 1 exit status
After really turning the Internet upside down, I found that you have to install an extra package using this command

sudo apt-get install libqt4-dev

By the way, the best thing about Qt that it's platform independent although you write it with C++, there is something else
called GTK that you can use.

that's all enjoy Qt !!




4 comments:

  1. ya 3ini yabny .. e7na 3amalna el project dah bel java :D

    ReplyDelete
  2. "(our open source godfather)"
    loooool :D
    thanks

    ReplyDelete
  3. eshta 3aleek ya 7'alood, bas enta 27'adt el CD we maraga3tahash :)

    ReplyDelete