Sei sulla pagina 1di 5

Mkdir libboost

./bootsh.sh
./bjam –prefix=/emotive/liboost
./bjam install

Install Rar
Error libc_2.7 not found

$ cd /tmp
$ wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz

Untar file
$ tar -zxvf rarlinux-3.6.0.tar.gz

Both unrar and rar commands are located in rar sub-directory. Just go to rar directory:
$ cd rar
$ ./unrar

$make

$make install

Now copy rar and unrar to /bin directory:


# cp rar unrar /bin

Yum install gcc-c++


Install Qt-x11-opensource
Đánh them lệnh PATH=/usr/local/Trolltech/Qt-4.3.0/bin:$PATH
Export PATH
Install qt-dev-tools
Install qt-4-3-0
Install qt-x11-opensource.gz
Install expat
http://www.boost.org/doc/libs/1_39_0/more/getting_started/unix-
variants.html#prepare-to-use-a-boost-library-binary
install Qt-creator….bin
Install qt4-devel

install gdb
cài qt-creator trước rùi cài qt-x11-opensource

export LD_LIBRARY_PATH=/emotive/bEDK/trunk/lib/linux:
$LD_LIBRARY_PATH

GCC/GDB/GNU make/Qt
(Ubuntu/Kubuntu Linux)
Installing GCC, GNU make, GDB
The packages you would need are gcc, cpp, g++, libc6-dev, libx11-dev, make and
gdb.

apt-get install gcc cpp g++ libc6-dev libx11-dev make gdb

Installing Qt binaries
Make sure you are using the universe components.

The packages you definitely need are: libqt4-core, libqt4-gui, libqt4-dev,


libqt4-debug, libqt4-debug-dev.

sudo apt-get install libqt4-core libqt4-gui libqt4-dev libqt4-debug


libqt4-debug-dev

If you plan to use Qt Designer, then install also qt4-designer. If you need Qt
Assistant and Qt Linguist, install qt4-dev-tools. For HTML documentation install
qt4-doc, although you might prefer to use Qt Assistant instead.

sudo apt-get install qt4-designer qt4-dev-tools qt4-doc

Installing Qt from source


You can download the source package for Linux from
http://www.trolltech.com/developer/downloads/qt/x11.

You need to extract the package, configure it, build it and finally set the environment
variables, so that you will be able to build Calitko and other Qt applications. The
following steps should be familiar to you if you have ever installed anything from
source under Linux:

$ tar –xzf qt-x11-opensource-src-4.1.4.tar.gz


$ cd qt-x11-opensource-src-4.1.4
$ ./configure
$ make
$ sudo make install

Lastly, you would like to add the path to your Qt binaries to the environment variable
PATH. A bash example:

PATH=/usr/local/Trolltech/Qt-4.1.4/bin:$PATH
export PATH

Download
For non-commercial development Qt is free of charge. We can easily download the
toolkit. We go to their download page. As we are talking about linux installation here,
we choose the Qt/X11 Open Source Edition. The file name is qt-x11-opensource-src-
4.2.3.tar.gz. The size of the file is 35.9MB. The file is archived and zipped. To unzip
the file, we type the following command.
tar -zxf qt-x11-opensource-src-4.2.3.tar.gz

The command will unzip all the files to a directory qt-x11-opensource-src-4.2.3. The
size of the directory is now 114.5 MB. Now it is time to carefully read the README
and the INSTALL file. There we will find detailed installation instructions. The
installations is easy and straightforward.

Install
We install the library the classic way. On Unix systems, installation of a software is
divided into three steps.

 Configuration
 Building
 Installation

First we run the configure script. The script will configure the library for our machine
type. By default, the qt will be installed in /usr/local/Trolltech/Qt-4.2.3 directory. This
can be changed by the -prefix parameter of the configure script. And it is the only
option, that I used. I decided to install the library into the /usr/local/qt4 directory.
Note that the installation word has two meanings here. It is the whole process
consisting of all three steps. And it also means 'moving files to specific directories',
which is the last, third step.

./configure -prefix /usr/local/qt4


This is the Qt/X11 Open Source Edition.

You are licensed to use this software under the terms of either
the Q Public License (QPL) or the GNU General Public License (GPL).

Type 'Q' to view the Q Public License.


Type 'G' to view the GNU General Public License.
Type 'yes' to accept this license offer.
Type 'no' to decline this license offer.

Do you accept the terms of either license? yes

The script will ask for licence acceptance. After we type yes, the script continues.

Qt is now configured for building. Just run 'make'.


Once everything is built, you must run 'make install'.
Qt will be installed into /usr/local/qt4

To reconfigure, run 'make confclean' and 'configure'.

After a shor period of time, the script will nicely inform about the outcome.

The building of the qt toolkit takes several hours. It depends on the power of your
processor. During the building my system went suddenly down. The temperature of
the processor reached the critical value. This was due to my inefficient cooling
probably. I always look at events optimistically. I figured out how to check
temperature on the command line
cat /proc/acpi/thermal_zone/THRM/temperature

I also realized, that when you restart the building, it will continue where it has
finished.

After the process finished, I saw no message like 'building finished successfully'. This
is common, but in my opinion not correct.

The last step is installing, or moving files to the directories.

sudo make install

This command finishes the installation process. The library is now installed in
/usr/local/qt4 directory. The size of the directory is 361.5 MB. As we can see, Qt is a
huge library.

The last thing that we do, is adding the qt4 path to the PATH system variable. bash
users, which are majority of linux users, need to edit the .profile file.

PATH=/usr/local/qt4/bin:$PATH
export PATH

The changes will be active after another login.

Testing a small example


Finally we will write a small code example.

#include <QApplication>
#include <QWidget>

int main(int argc, char *argv[])


{
QApplication app(argc, argv);

QWidget window;

window.resize(250, 150);
window.setWindowTitle("Simple example");
window.show();

return app.exec();
}

To build this example, we will use a very handy tool called qmake.

qmake -project
qmake
make

If the qt4 installation directory is not a part of the PATH variable, we can provide the
full path to the qmake tool.
/usr/local/qt4/qmake -project
/usr/local/qt4/qmake
make

Simple Qt4 example

Potrebbero piacerti anche