1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
|
INSTALLING QT FOR X11
You may need to be root, depending on the permissions of the directories
you choose to install Qt in.
1. Unpack the archive, unless you already have:
cd /usr/local
gunzip qt-1.33.tar.gz # uncompress the archive
tar xf qt-1.33.tar # unpack it
This creates the directory /usr/local/qt-1.32 containing the
files from the main archive.
Rename qt-1.33 to qt (or make a symlink):
mv qt-1.33 qt
The rest of this file assumes that Qt is installed in /usr/local/qt.
2. Set some environment variables in .profile or .login, depending
on your shell.
QTDIR - wherever you installed Qt
PATH - to locate the moc program
MANPATH - to access the Qt man pages
LD_LIBRARY_PATH - for the shared Qt library
If you're using GNU gcc, you may also want to set these:
LIBRARY_PATH - contains library file path
CPLUS_INCLUDE_PATH - contains C++ include file path
In .profile (in case your shell if bash, ksh, zsh or sh):
QTDIR=/usr/local/qt
PATH=$QTDIR/bin:$PATH
MANPATH=$QTDIR/man:$MANPATH
LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
LIBRARY_PATH=$LD_LIBRARY_PATH
CPLUS_INCLUDE_PATH=$QTDIR/include:$CPLUS_INCLUDE_PATH
export QTDIR PATH MANPATH LD_LIBRARY_PATH LIBRARY_PATH
export CPLUS_INCLUDE_PATH
In .login (in case your shell is csh or tcsh):
if ( ! $?QTDIR ) then
setenv QTDIR /usr/local/qt
endif
if ( $?PATH ) then
setenv PATH $QTDIR/bin:$PATH
else
setenv PATH $QTDIR/bin
endif
if ( $?MANPATH ) then
setenv MANPATH $QTDIR/man:$MANPATH
else
setenv MANPATH $QTDIR/man
endif
if ( $?LD_LIBRARY_PATH ) then
setenv LD_LIBRARY_PATH $QTDIR/lib:$LD_LIBRARY_PATH
else
setenv LD_LIBRARY_PATH $QTDIR/lib
endif
if ( ! $?LIBRARY_PATH ) then
setenv LIBRARY_PATH $LD_LIBRARY_PATH
endif
if ( $?CPLUS_INCLUDE_PATH ) then
setenv CPLUS_INCLUDE_PATH $QTDIR/include:$CPLUS_INCLUDE_PATH
else
setenv CPLUS_INCLUDE_PATH $QTDIR/include
endif
3. Compile the Qt library, the example programs and the tutorial.
The qt directory contains a Makefile which compiles everything
(including the examples and the tutorial) for all platforms.
Type:
make
You'll see a long list of platform/compiler/library combinations,
for example "linux-gcc-shared" and "solaris-cc-static".
We recommend that you build a shared library. Applications linked
with shared libraries get much smaller than those linked with
static libraries.
To choose a shared library for Linux, using the GCC compiler:
make linux-gcc-shared
To create the library and compile all examples and the tutorial:
make
If your platform or compiler is not listed, read PORTING. If it
is listed but you have problems, see http://www.troll.no/platforms/
4. In very few cases you may need to run /sbin/ldconfig or something
similar at this point if you are using shared libraries.
If you have problems running the example programs, e.g. messages like
can't load library 'libqt.so.1'
you probably need to put a reference to the qt library in a
configuration file and run /sbin/ldconfig as root on your system.
And don't forget to set LD_LIBRARY_PATH as explained in 2) above.
5. The online HTML documentation is installed in /usr/local/qt/html/
The main page is /usr/local/qt/html/index.html
The man pages are installed in /usr/local/qt/man/
That's all. Qt is now installed.
|