<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- /tmp/qt-4.2.1-harald-1161357942206/qt-x11-opensource-src-4.2.1/doc/src/installation.qdoc --> <head> <title>Qt 4.2: Installing Qt/Mac</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td> <td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td> <td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">Installing Qt/Mac<br /><small></small></h1> <p><b>Note:</b> If you have obtained a binary package for this platform, consult the installation instructions provided instead of the ones in this document.</p> <ol type="1"> <li>If you have the commercial edition of Qt, install your license file as <tt>$HOME/.qt-license</tt>.<p>For the open source version you do not need a license file.</p> </li> <li>Unpack the archive if you have not done so already. For example, if you have the <tt>qt-mac-opensource-desktop-4.2.1.tar.gz</tt> package, type the following commands at a command line prompt:<pre> cd /tmp gunzip qt-mac-opensource-desktop-4.2.1.tar.gz # uncompress the archive tar xvf qt-mac-opensource-desktop-4.2.1.tar # unpack it</pre> <p>This creates the directory <tt>/tmp/qt-mac-opensource-desktop-4.2.1</tt> containing the files from the archive.</p> </li> <li>Building<p>To configure the Qt library for your machine type, run the <tt>./configure</tt> script in the package directory.</p> <p>By default, Qt is configured for installation in the <tt>/usr/local/Trolltech/Qt-4.2.1</tt> directory, but this can be changed by using the <tt>-prefix</tt> option. Alternatively, the <tt>-prefix-install</tt> option can be used to specify a "local" installation within the source directory.</p> <pre> cd /tmp/qt-mac-opensource-desktop-4.2.1 ./configure</pre> <p>Type <tt>./configure -help</tt> to get a list of all available options.</p> <p>Note that you will need to specify <tt>-universal</tt> if you want to build universal binaries, and also supply a path to the <tt>-sdk</tt> option if your development machine has a PowerPC CPU. By default, Qt is built as a framework, but you can built it as a set of dynamic libraries (dylibs) by specifying the <tt>-no-framework</tt> option.</p> <p>To create the library and compile all the demos, examples, tools, and tutorials, type:</p> <pre> make</pre> <p>If you did not configure Qt using the <tt>-prefix-install</tt> option, you need to install the library, demos, examples, tools, and tutorials in the appropriate place. To do this, type:</p> <pre> sudo make install</pre> <p>and enter the root password.</p> <p><b>Note:</b> If you later need to reconfigure and rebuild Qt from the same location, ensure that all traces of the previous configuration are removed by entering the build directory and typing <tt>make confclean</tt> before running <tt>configure</tt> again.</p> </li> <li>Environment variables<p>In order to use Qt, some environment variables need to be extended.</p> <pre> PATH - to locate qmake, moc and other Qt tools</pre> <p>This is done like this:</p> <p>In <tt>.profile</tt> (if your shell is bash), add the following lines:</p> <pre> PATH=/usr/local/Trolltech/Qt-4.2.1/bin:$PATH export PATH</pre> <p>In <tt>.login</tt> (in case your shell is csh or tcsh), add the following line:</p> <pre> setenv PATH /usr/local/Trolltech/Qt-4.2.1/bin:$PATH</pre> <p>If you use a different shell, please modify your environment variables accordingly.</p> </li> <li>That's all. Qt is now installed.<p>If you are new to Qt, we suggest that you take a look at the demos and examples to see Qt in action. Run the Qt Examples and Demos either by typing <tt>qtdemo</tt> on the command line or through the desktop's Start menu.</p> <p>You might also want to try the following links:</p> <ul> <li><a href="how-to-learn-qt.html">How to Learn Qt</a></li> <li><a href="tutorial.html">Qt Tutorial</a></li> <li><a href="http://www.trolltech.com/developer">Developer Zone</a></li> <li><a href="deployment.html">Deploying Qt Applications</a></li> </ul> </li> </ol> <p>We hope you will enjoy using Qt. Good luck!</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="30%">Copyright © 2006 <a href="trolltech.html">Trolltech</a></td> <td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="30%" align="right"><div align="right">Qt 4.2.1</div></td> </tr></table></div></address></body> </html>