Building Qt on Mac OS X

From BATCOM-IT Services Wiki
Jump to: navigation, search

Creating a Qt programming environment on Mac OS X


Download the latest Qt source code:

Building Qt

Extract this tar-ball to a directory where you are going to build it (note this Qt bug which may still be valid, Qt 4.8.6 test pending), then configure and build it completely:

 $ mkdir -p ~/src && cd ~/src
 $ gzcat /tmp/qt-everywhere-opensource-src-4.8.7.tar.gz | tar xfv -
 $ cd qt-everywhere-opensource-src-4.8.7
 $ ./configure -fast -opensource -confirm-license -release
 $ make -j5

For Qt 5, omit the -fast option on the configure command line as the option no longer exists.


Install the library (it will be installed to /usr/local/Trolltech/Qt-4.8.6)

$ sudo make install

and make sure that /usr/local/Trolltech/Qt-4.8.7/bin is part of the $PATH environment variable. Add it before all system-defined default binary paths to avoid calling any left-overs from an old Qt installation, like in this example:

$ echo $PATH

See also

Mac OS X specific official installation instructions: