Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# Installing TQt/Mac

You may need to be logged in as root, depending on the permissions of the directories where you choose to install TQt.

1. Unpack the archive if you have not done so already:

           cd /Developer
           gnutar xzf qt-mac-version.tar.gz

   This creates the directory /Developer/qt-version containing the files from the main archive.

   Rename qt-version to qt (or make a symlink):

           mv qt-version qt

   The rest of this file assumes that TQt is unpacked in `/Developer/qt`.

2. Set some environment variables in the file `.profile` (or `.login`, depending on your shell) in your home directory. Create the file if it is not there already.

   - TQTDIR -- the directory in which you're building TQt
   - PATH -- to locate the moc program and other TQt tools
   - MANPATH -- to access the TQt man pages
   - LD_LIBRARY_PATH -- for the shared TQt library

   This is done like this:

   In `.profile` (if your shell is bash, ksh, zsh or sh), add the following lines:

           TQTDIR=/Developer/qt
           PATH=$TQTDIR/bin:$PATH
           MANPATH=$TQTDIR/man:$MANPATH
           DYLD_LIBRARY_PATH=$TQTDIR/lib:$DYLD_LIBRARY_PATH

           export TQTDIR PATH MANPATH DYLD_LIBRARY_PATH

   In `.login` (in case your shell is csh or tcsh), add the following lines:

           setenv TQTDIR /Developer/qt
           setenv PATH $TQTDIR/bin:$PATH
           setenv MANPATH $TQTDIR/man:$MANPATH
           setenv DYLD_LIBRARY_PATH $TQTDIR/lib:$DYLD_LIBRARY_PATH

   After you have done this, you will need to login again, or re-source the profile before continuing.

3. If you have the commercial edition of TQt, install your license file as `$HOME/.qt-license`.

4. Compile the TQt library, and build the example programs, the tutorial and the tools (e.g. TQt Designer) as follows.

   Type:

           cd $TQTDIR
           ./configure

   This will configure the TQt library for your machine. Note that GIF support is turned off by default. Run `./configure -help` to get a list of configuration options.

   To create the library and compile all examples and the tutorial:

           make

   If you have problems, see http://www.trolltech.com/platforms/.

5. Once you have built TQt, it is ready to use. If TQt has not been configured with the -static option, then in order to be able to launch TQt applications from the Finder you must place the relevant libraries in a directory where they can be found. We recommend making these symbolic links (if you have configured TQt with -thread please change the libtqt below with libtqt-mt):

           ln -sf $TQTDIR/lib/libtqt.3.dylib /usr/lib
           ln -sf $TQTDIR/lib/libtqui.1.dylib /usr/lib

   You may need to have 'administrator' access to do this, (in which case, precede each command with `sudo'`, e.g. `sudo ln -s ...`). If you use sudo you'll be prompted for the administrator password.

   If you do not have administrator access, or you would prefer to do a user install (rather than system install) of the libraries you can do (if you have configured TQt with -thread please change the libtqt below with libtqt-mt):

           ln -sf $TQTDIR/lib/libtqt.3.dylib $HOME/lib
           ln -sf $TQTDIR/lib/libtqui.1.dylib $HOME/lib

That's all! TQt is now installed. TQt's documentation can be read with TQt Assistant or by any web browser; the contents page is `$TQTDIR/doc/html/index.html`.