Qt 5.14.0 beta x64 Windows build from source
-
Hi there,
I downloaded the qt-everywhere-src-5.14.0-beta1.zip archive from the Qt website and like to use the open source license.
Usually for program developement I use Qt Creator with MSVC 2019 or Visual Studio 2019 with Qt Visual Studio Tools. I only develope Qt Windows 10 64 bit desktop applications.
Is it possible to use Qt Creator or Visual Studio IDE to build Qt from source using the provided qt.pro project file?
Is it mandatory to have Perl and Python installed (I don't use Qt quick or qtwebengine)?
What is the easiest less error prone method to build Qt from source for a novice?Best regards,
mireiner -
All is described here: https://doc.qt.io/qt-5/windows-building.html
-
I already followed that tutorial. It looks straight forward to me:
-
Extracted archive qt-everywhere-src-5.14.0-beta1.zip to C:\Qt\Qt5.14.0
Copied and pasted the following commands from the tutorial (only edited paths of vcvarsall.bat and Qt).
-
Set paths:
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" \c amd64
SET _ROOT=C:\Qt\Qt5.14.0
SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
SET _ROOT= -
Configure:
configure -debug -nomake examples -nomake tests -skip qtwebengine -opensource
But this leads to an error message:
C:\Qt\Qt5.14.0>configure -debug -nomake examples -nomake tests -skip qtwebengine -opensource
'+' cd qtbase
'+' C:\Qt\Qt5.14.0\qtbase\configure.bat -top-level -debug -nomake examples -nomake tests -skip qtwebengine -opensource
Bootstrapping qmake ...Microsoft (R) Program Maintenance Utility, Version 14.23.28106.4
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.cl -c -Fo./ -Fdqmake.pdb -W2 -nologo -O2 /MP /wd4577 -IC:\Qt\Qt5.14.0\qtbase\qmake -IC:\Qt\Qt5.14.0\qtbase\qmake\library -IC:\Qt\Qt5.14.0\qtbase\qmake\generators -IC:\Qt\Qt5.14.0\qtbase\qmake\generators\unix -IC:\Qt\Qt5.14.0\qtbase\qmake\generators\win32 -IC:\Qt\Qt5.14.0\qtbase\qmake\generators\mac -IC:\Qt\Qt5.14.0\qtbase/include -IC:\Qt\Qt5.14.0\qtbase/include\QtCore -IC:\Qt\Qt5.14.0\qtbase/include\QtCore\5.14.0 -IC:\Qt\Qt5.14.0\qtbase/include\QtCore\5.14.0\QtCore -I..\src\corelib\global -IC:\Qt\Qt5.14.0\qtbase\mkspecs\win32-msvc -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -DQT_VERSION_STR=\"5.14.0\" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=14 -DQT_VERSION_PATCH=0 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH -DUNICODE -D_ENABLE_EXTENDED_ALIGNED_STORAGE -c -Yc -Fpqmake_pch.pch -TP C:\Qt\Qt5.14.0\qtbase\qmake\qmake_pch.h
qmake_pch.h
C:\Qt\Qt5.14.0\qtbase\include\QtCore../../src/corelib/global/qglobal.h(45): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "type_traits": No such file or directory
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\Hostx64\x64\cl.EXE"": Rückgabe-Code "0x2"
Stop.The path mentioned in the error message looks curious to me:
C:\Qt\Qt5.14.0\qtbase\include\QtCore../../src/corelib/global/qglobal.hqglobal is sitting in directory:
C:\Qt\Qt5.14.0\qtbase\include\QtCore\qglobal.hWhat is the reason it didn't work? Did I miss something?
-
-
@mireiner said in Qt 5.14.0 beta x64 Windows build from source:
What is the reason it didn't work?
As you can see from the output:
fatal error C1083: Datei (Include) kann nicht geöffnet werden: "type_traits": No such file or directory
So your compiler setup is wrong - this is a header which is provided by your compiler.
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" <arch>
arch is either amd64 or x86, you're passing '\c amd64' which is for sure not correct and the batch file also tells you that this is wrong but you ignored it. -
@mireiner said in Qt 5.14.0 beta x64 Windows build from source:
What is the reason it didn't work?
As you can see from the output:
fatal error C1083: Datei (Include) kann nicht geöffnet werden: "type_traits": No such file or directory
So your compiler setup is wrong - this is a header which is provided by your compiler.
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" <arch>
arch is either amd64 or x86, you're passing '\c amd64' which is for sure not correct and the batch file also tells you that this is wrong but you ignored it.I found the solution by searching the error in this forum:
https://forum.qt.io/topic/97758/qglobal-h-45-fatal-error-c1083-cannot-open-include-file-type_traits-no-such-file-or-directoryI was running the commands on PowerShell. The problem is resolved by using a command prompt!
And the correct path call for msvc compiler is:
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64The Qt documention says the parameter for vcvarsall.bat is for example \c x86... But that might be a typo because the leading '\c' is wrong and won't work.
-
@mireiner said in Qt 5.14.0 beta x64 Windows build from source:
x86_amd64
Why do you want to use 32bit toolchain to create 64 bit apps? I would suggest using 'amd64'.
-
@mireiner said in Qt 5.14.0 beta x64 Windows build from source:
x86_amd64
Why do you want to use 32bit toolchain to create 64 bit apps? I would suggest using 'amd64'.
@Christian-Ehrlicher said in Qt 5.14.0 beta x64 Windows build from source:
Why do you want to use 32bit toolchain to create 64 bit apps? I would suggest using 'amd64'.
Is 'x86_amd64' the parameter for Qt Windows 32 bit build? Oh, I have a hard time to understand the correct parameter names. I'm not used to handle command line tools. So you say for Qt Windows 64 bit build 'amd64' is correct? Ok I'll will use that. Thank you!
-
@Christian-Ehrlicher said in Qt 5.14.0 beta x64 Windows build from source:
See https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019
Ok, thanks now I understand. Before I wasn't sure what to use because MSCV IDE is 32 bit and it is located in C:\Programs (x86)... path. So I thought the MSVC command line compiler might be a 32 bit tool that produces 64 bit code. But anyway 'vcvarsall.bat amd64' worked fine.
The only thing didn't work was building the doc files in a second step. But the doc files are not importend for me in this beta state.
Thanks again for your help!