| 1 |
INSTALLING Qt Source Package Version %VERSION%. |
| 2 |
|
| 3 |
1. If you have the commercial edition of Qt, install your license |
| 4 |
file as $HOME/.qt-license if you are on Unix. If you are on |
| 5 |
Windows, copy the license file into your home directory |
| 6 |
(this may be known as the userprofile environment variable) and |
| 7 |
rename it to .qt-license. For example on Windows XP, |
| 8 |
%USERPROFILE% should be something like C:\Documents and |
| 9 |
Settings\username. |
| 10 |
|
| 11 |
For the open source version you do not need a license file. |
| 12 |
|
| 13 |
2. Unpack the archive if you have not done so already: |
| 14 |
|
| 15 |
On Unix (X11 and Mac): |
| 16 |
cd /tmp |
| 17 |
gunzip %DISTNAME%.tar.gz # uncompress the archive |
| 18 |
tar xvf %DISTNAME%.tar # unpack it |
| 19 |
|
| 20 |
This creates the directory /tmp/%DISTNAME% containing the files |
| 21 |
from the archive. We only support the GNU version of the tar |
| 22 |
archiving utility. Note that on some systems it is called gtar. |
| 23 |
|
| 24 |
On Windows, uncompress the files into the directory you want Qt |
| 25 |
installed, e.g. C:\Qt\%VERSION%. |
| 26 |
|
| 27 |
NOTE: The install path must not contain any spaces. |
| 28 |
|
| 29 |
4. Environment variables |
| 30 |
|
| 31 |
In order to build and use Qt, the PATH environment variable needs |
| 32 |
to be extended to locate qmake, moc and other Qt tools |
| 33 |
|
| 34 |
On Windows, this is done by adding C:\Qt\%VERSION%\bin |
| 35 |
to the PATH variable. On Unix, this is done by adding |
| 36 |
/tmp/%DISTNAME%. |
| 37 |
|
| 38 |
For newer versions of Windows, PATH can be extended through |
| 39 |
"Control Panel->System->Advanced->Environment variables" and for |
| 40 |
older versions by editing C:\autoexec.bat. |
| 41 |
|
| 42 |
In .profile (if your Unix shell is bash), add the following lines: |
| 43 |
|
| 44 |
PATH=/usr/local/Trolltech/Qt-%VERSION%/bin:$PATH |
| 45 |
export PATH |
| 46 |
|
| 47 |
In .login (in case your Unix shell is csh or tcsh), add the following line: |
| 48 |
|
| 49 |
setenv PATH /usr/local/Trolltech/Qt-%VERSION%/bin:$PATH |
| 50 |
|
| 51 |
If you use a different Unix shell, please modify your environment |
| 52 |
variables accordingly. |
| 53 |
|
| 54 |
For some X11 compilers that do not support rpath you must also |
| 55 |
extended the LD_LIBRARY_PATH environment variable to include |
| 56 |
/usr/local/Trolltech/Qt-%VERSION%/lib. On Linux or Mac with GCC |
| 57 |
this step is not needed. |
| 58 |
|
| 59 |
4. Building |
| 60 |
|
| 61 |
4.1 Building on Unix |
| 62 |
|
| 63 |
To configure the Qt library for your machine type, run the |
| 64 |
./configure script in the package directory. |
| 65 |
|
| 66 |
By default, Qt is configured for installation in the |
| 67 |
/usr/local/Trolltech/Qt-%VERSION% directory, but this can be |
| 68 |
changed by using the -prefix option. Alternatively, the |
| 69 |
-prefix-install option can be used to specify a "local" |
| 70 |
installation within the source directory. |
| 71 |
|
| 72 |
cd /tmp/%DISTNAME% |
| 73 |
./configure |
| 74 |
|
| 75 |
Type "./configure -help" to get a list of all available options. |
| 76 |
|
| 77 |
To create the library and compile all the demos, examples, tools, |
| 78 |
and tutorials, type: |
| 79 |
|
| 80 |
make |
| 81 |
|
| 82 |
If you did not configure Qt using the -prefix-install option, |
| 83 |
you need to install the library, demos, examples, tools, and |
| 84 |
tutorials in the appropriate place. To do this, type: |
| 85 |
|
| 86 |
su -c "make install" |
| 87 |
|
| 88 |
and enter the root password. On some systems, you have to use the |
| 89 |
sudo command as follows: |
| 90 |
|
| 91 |
sudo make install |
| 92 |
|
| 93 |
and enter your password, this requires that you have administrator access |
| 94 |
to your machine. |
| 95 |
|
| 96 |
Note that on some systems the make utility is named differently, |
| 97 |
e.g. gmake. The configure script tells you which make utility to |
| 98 |
use. |
| 99 |
|
| 100 |
If you need to reconfigure and rebuild Qt from the same location, |
| 101 |
ensure that all traces of the previous configuration are removed |
| 102 |
by entering the build directory and typing |
| 103 |
|
| 104 |
make confclean |
| 105 |
|
| 106 |
before running the configure script again. |
| 107 |
|
| 108 |
4.2 Building on Windows |
| 109 |
|
| 110 |
To configure the Qt library for your machine type: |
| 111 |
|
| 112 |
C: |
| 113 |
cd \Qt\%VERSION% |
| 114 |
configure |
| 115 |
|
| 116 |
Type "configure -help" to get a list of all available options. |
| 117 |
|
| 118 |
If you are using the "-direct3d" option, make sure that you have |
| 119 |
the Direct3D SDK installed, and that you have run the |
| 120 |
%DXSDK_DIR%\Utilities\Bin\dx_setenv.cmd command, before attempting |
| 121 |
to run configure. |
| 122 |
|
| 123 |
The actual commands needed to build Qt depends on your development |
| 124 |
system. For Microsoft Visual Studio to create the library and |
| 125 |
compile all the demos, examples, tools and tutorials type: |
| 126 |
|
| 127 |
nmake |
| 128 |
|
| 129 |
If you need to reconfigure and rebuild Qt from the same location, |
| 130 |
ensure that all traces of the previous configuration are removed |
| 131 |
by entering the build directory and typing |
| 132 |
|
| 133 |
nmake confclean |
| 134 |
|
| 135 |
before running the configure script again. |
| 136 |
|
| 137 |
5. That's all. Qt is now installed. |
| 138 |
|
| 139 |
If you are new to Qt, we suggest that you take a look at the demos |
| 140 |
and examples to see Qt in action. Run the Qt Examples and Demos |
| 141 |
either by typing 'qtdemo' on the command line or through the |
| 142 |
desktop's Start menu. |
| 143 |
|
| 144 |
You might also want to try the following links: |
| 145 |
|
| 146 |
http://qt.nokia.com/doc/%VERSION%/how-to-learn-qt.html |
| 147 |
http://qt.nokia.com/doc/%VERSION%/tutorial.html |
| 148 |
http://qt.nokia.com/developer |
| 149 |
|
| 150 |
We hope you will enjoy using Qt. Good luck! |