Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download QT static build on windows [closed]

I have been trying for months to get QT 5.2.X to compile statically for MinGW on Windows, none of the online guides work. Is there a website that has pre-built the libraries for MinGW QT 5.2.x that is available for download?

like image 738
user3205087 Avatar asked Mar 10 '14 02:03

user3205087


2 Answers

After a few hours of googling I managed to get it working for Qt 5.0.2, and have recently successfully applied the same steps for the 5.2.1 version.

Retrieve the sources from http://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.zip and extract them inside C:\Qt\5.2.1-static-thedate\ so that you'll have the configure.bat file directly in C:\Qt\5.2.1-static-thedate. Using date-based folders can be usefull when dealing with multiple versions of Qt.

Then open a command prompt in that folder and execute the following command to display all the possible flags, you may want to set or unset.

configure -platform win32-g++ -?

I personnaly have chosen this command line for compiling my static version, it suits my needs, but you'll probably have to adjust it to fit yours.

configure -debug-and-release -opensource -static -nomake examples -nomake tests -nomake tools -accessibility -no-sql-sqlite -no-opengl -platform win32-g++ -no-neon -system-proxies -qt-zlib -qt-libpng -qt-libjpeg -confirm-license

That's almost it, Qt is ready to be compiled. Then, use this command to launch the make, with 4 being the number of parallel threads you want to use for compiling (please note that parallel compiling might cause some errors, just relaunch the command when it happens, it should be fine). This step is rather long.

mingw32-make -j 4

Then launch this command to clean the intermediate files used for compilation.

mingw32-make clean

Last thing to do is register this new version of Qt in your Qt Creator, and ... you're done :) !

like image 129
nschurando Avatar answered Oct 25 '22 02:10

nschurando


Precompiled Qt4 and Qt5

I spent a considerable amount of time compiling Qt4 and Qt5 with MySQL and OpenSSL support on Windows using Microsoft Visual Studio. I compile all libraries statically and dynamically, in release and debug mode, for both 32- and 64-bit. Qt is a big beast that comes along with plenty of quirks when it comes to building it from scratch. It takes me around a day’s worth of compiling to build both Qt4 and Qt5, together with their dependencies.

The binaries posted here are experimental and any comments would be welcome. If you use these Qt builds, you should know the following:

  • You should only use these Qt precompiled libraries, and their dependencies, with the respective MSVC only.
  • All static libraries use Static Runtimes (built with /MT or /MTd).
  • All shared libraries use Dynamic Runtimes (built with /MD or /MDd).
  • Statically-built Qt does not include Webkit or Declarative.
  • I do not compile or include demos, examples and translations.
  • I build only shared version of the Qt tools (assistant, designer, etc.) in Release mode.
  • Perl, Python and Ruby, are useful as tools to build Qt, they are not linked against, and you won’t need them.
  • Qt, ICU (only necessary until Qt5 v5.5.0), MariaDB and OpenSSL precompiled binaries are custom-built. Downloading official binary releases won’t work with the rest of the binaries here!!.
  • Instead of Oracle’s MySQL I use MariaDB, both work just fine with Qt.

http://www.npcglib.org/~stathis/blog/precompiled-qt4-qt5/

like image 21
Geograph Avatar answered Oct 25 '22 02:10

Geograph