Skip to content

1.4 Building Qt from Source

Phil Duby edited this page Mar 15, 2020 · 2 revisions

Motivation

The reason for building from source for Windows is so one can use VS Express as one's IDE. And at least as of this writing, the binary download of Qt 5.2.1 doesn't include the zip library, which would mean adding that manually (which is not that difficult, but takes a little time).

The reason for doing so under Mac used to be because we do fritzing builds with the ppc, x86 and x86_64 options and the set of all 3 is not available in a single precompiled library. However, with Qt 5, support for ppc is dropped, and for the moment we are not even supporting x86 builds.

For Linux we are now downloading a precompiled SDK.

Process

To get started, download the Qt source archive (lately from qt-project.org). Remember, this is the source archive and not one of the precompiled libraries--they seem to make this harder to find on the download page. As of this writing, we are using Qt 5.2.1.

Now unarchive the source folder someplace. It is not small.

Open a terminal and cd into the unarchived top level folder. For building for Visual Studio express, the terminal should be the Visual Studio Express command line.

For qt 4.8.5, for Windows (VS 2012), use the following:

configure -fast -debug-and-release -opensource -plugin-sql-sqlite -no-qt3support -platform win32-msvc2012 -qt-zlib -qt-libpng -qt-libtiff -qt-libjpeg -no-mmx -no-3dnow -no-sse -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-neon -no-dbus -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-webkit -no-script -no-scripttools -no-declarative -no-declarative-debug -mp

For Qt 4.8.5 for Mac, use the following:

./configure -fast -debug-and-release -opensource -plugin-sql-sqlite -no-qt3support -platform macx-g++ -qt-zlib -qt-libpng -qt-libtiff -qt-libjpeg -no-mmx -no-3dnow -no-sse -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-neon -no-dbus -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-webkit -no-script -no-scripttools -no-declarative -no-declarative-debug -arch x86 -arch ppc -arch x86_64

For Qt 4.8.5 for Linux, use the following:

./configure -fast -debug-and-release -opensource -plugin-sql-sqlite -no-qt3support -platform linux-g++ -qt-zlib -qt-libpng -qt-libtiff -qt-libjpeg -no-mmx -no-3dnow -no-sse -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-neon -no-dbus -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-webkit -no-script -no-scripttools -no-declarative -no-declarative-debug

To reconfigure in case of errors, run make confclean (under Windows: nmake confclean) then run configure again.