how to install qt5.10?

Qt installer is about the most awful installer I’ve ever seen.Qt team want to make their program appear as professional as Microsoft Visual Studio.Unfortunately, they forget what makes their program popular in the past. They try to update the versions of their program frequently like Windows’ version(xp,7,8,10), even faster, to attract the attention of programmers and keep their program look more advanced. Every version of Qt takes the form of an exe file larger than 1G that takes long time to download for slow internet connection.

They hide the open source version of Qt(GPL/LGPL license) from their homepage qt.io, and qt.io/download. If you want to download Qt open source version on their homepage, you will be led to a contact page to fill a form to expose your privacy or buy their commercial version of Qt.

You’ll eventually find the open source(GPL/LGPL) versions of Qt on download.qt.io. The files on that web are a mess. The officially released versions of Qt are hidden in http://download.qt.io/official_releases/qt/, and you will see a bunch of versions 4.8,5.6,5.7,5.8,5.9,5.10, each has a file larger than 1G.

You may think, aha,I finally find the qt installer and the rest is simply downloading the installer and clicking it to install on your computer. But successfully installing Qt is far from just downloading and clicking to run.

From Qt5.9, they do not support MingW any longer. In fact, the support of Mingw was limited long time ago. For example, you cannot build webengine related programs with mingw in earlier releases(Project ERROR: Unknown module(s) in QT: webenginewidgets). Everything turns to MSVC. Although the installer has a name like qt-opensource-windows-x86-msvc2013_64-5.8.0.exe, it does not include msvc tool chain in the package as it does for mingw build. You have to install MSVC first. Note that the installation order of MSVC and Qt is important. You must install the correct version of MSVC such as MSVC 2015, MSVC 2017 first, reboot your computer, then install Qt. If you install Qt before MSVC, you may meet the following error building project:
Could not determine which “make” command to run. Check the “make” step in the build configuration.
That is because Qt creator can not find the build tools of MSVC. If you’ve read about my article about configuring the compiling tools for Qt creator, you may want to manually add the MSVC compilers now. Unfortunately, even after you set the compiler path to like c:\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\Hostx64\x64\cl.exe and Make path to like c:\Microsoft \Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\Hostx64\x64\nmake.exe,you’ll meet the following errors:
msvc2017_64\include\qtcore\qglobal.h(45): fatal error C1083: cannot open include file: “type_traits”: No such file or directory
The kit Desktop Qt 5.10.0 MSVC2017 64bit has configuration issues which might be the root cause for this problem.
Even you set a header path:C:\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\, which includes the header file: type_traits, the above errors persist.

If you installed MSVC before Qt, you’ll find several auto-detected compilers in Qt creator.One of them is “Microsoft Visual C++ Compiler 15.0 (x86_amd64)”. Because my computer runs 64bit OS, I use this compiler for the build kit “Desktop Qt 5.10.0 MSVC2017 64bit” for my project. Note that although there is an “amd” in the name of the compiler, it has nothing to do with intel/amd. You can use this compiler even you run on an intel CPU.If you choose a wrong compiler such as “Microsoft Visual C++ Compiler 15.0 (x86)”, you will get the error:
fatal error LNK1112: module computer model x64 conflicts with target computer type: x86

There is another auto-detected build kit:Desktop Qt 5.10.0 MSVC2015 32bit, which can use “Microsoft Visual C++ Compiler 15.0 (x86)” as its compiler, even you installed MSVC2017. Note that Qt creator itself is a 32bit program, but it has no problem building a 64bit program.

The worst thing in the process of installing Qt is that it takes hours to complete the installation. On my computer, it takes a whole night to finish. The installed files occupies over 10G disk space. And even worse, it took another night to uninstall Qt when I tried to remove a wrong version of Qt. The un-installation process halted at deleting numerous source files.But it did not freeze or die, you can see the progress if you click the “details” button.

Posted in

Comments are closed, but trackbacks and pingbacks are open.