Static Builds not Working
-
@ed-wright
Yes, that is the source code. But there is also Qt 5.11
but i assume you been using 5.10.1 ? ( its perfectly fine)
You will then compile a static version from it.
Make sure to reads docs carefully as else it fails and you been wasting hours looking at it compiling. -
@ed-wright
That is fine. Not an issue. just wanted to be clear up front as the
compiling time is not trivial .) -
I have been trying to compile the static version of Qt now and have run into a few issues.
Following http://doc.qt.io/qt-5/windows-building.html to try to build the
static version of Qt.STEP 1
As i use Qt Creator and i have put the License into the prompt this step is
doneSTEP 2
I already have a directory called C:\QT\Qt5.10.1, but from the downloads page
in my account i also have downloaded (Qt Source Package, Full Framework with
Windows style line endings ) and it is unpacked and located at C:\QT\qt-
everywhere-src-5.10.1, my project is currently using the first path.STEP 3
With the environment variables, in my PATH i have
C:\QT\vs2015\qt5.6.1-64\5.6\msvc2015_64\bin, i do not think this is correct as
i want to be using 5.10.1 with msvs2015 so i think it needs to be.
C:\QT\Qt5.10.1\5.10.1\msvc2015_64\bin is this correct?Anyway, following the guide my file qt5vars.cmd has the following:
REM Set up \Microsoft Visual Studio 14, where <arch> is \c amd64, \c
x86, etc.
CALL "C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\vcvarsall.bat" amd64
SET _ROOT=C:\QT\qt-everywhere-src-5.10.1
SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
REM Uncomment the below line when using a git checkout of the source
repository
REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH%
SET _ROOT=NOTE: i am trying to use the downloaded (Qt Source Package, Full Framework
with Windows style line endings) not the normal 5.10.1 build.NOTE2: This produces the following when running in the cmd off the shortcut on
the desktop:C:\WINDOWS>REM Set up \Microsoft Visual Studio 14, where <arch> is \c
amd64, \c
x86, etc.C:\WINDOWS>CALL "C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\vcvarsal
l.bat" amd64STEP 4
Using the Developer Command Prompt for VS2015 i navigate to C:\QT\qt-
everywhere-src-5.10.1and run the following configure -debug -nomake examples -nomake tests -skip
qtwebengine -opensourcei get the following errors
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
Studio 14.0
\VC\BIN\cl.EXE"' : return code '0x2' -
Okay an update, Still not working but got a little further.
I have added the line:
set CL=/I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt"to the file, C:\QT\qt-everywhere-src-5.10.1\configure.bat
it now progresses further BUT now i get this error:
LINK : fatal error LNK1104: cannot open file 'libucrt.lib'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.EXE"' : return code '0x450'
Stop.im trying to find libucrt.lib as we speak
-
Hi
Good work.
I have not seen that one before, but it seems to be related to static linking
https://stackoverflow.com/questions/35805113/visual-studio-2015-run-time-dependencies-or-how-to-get-rid-of-universal-crt -
Adding the following to my configure.bat located in the C:\QT\qt-everywhere-src-5.10.1 directory allowed me to overcome this problem.
set INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt set LIB=%LIB%;C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86
Onto the next issue now.
I have successfully run the command
configure -debug -nomake examples -nomake tests -skip qtwebengine -opensource -static
The next part of the guide states that the following command should be run.
nmake
Once running it went for a few minutes and then produced the following error
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0 Copyright (C) Microsoft Corporation. All rights reserved. cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zi -MDd -utf-8 -W0 /Fd..\..\..\lib\qtpcre2d.pdb -DUNICODE -D_UNICODE -DWIN32 -DPCRE2_CODE_UNIT_WIDTH=16 -DPCRE2_STATIC -DQT_NO_NARROWING_CONVER SIONS_IN_CONNECT -DHAVE_CONFIG_H -DQT_NO_DYNAMIC_CAST -DQT_NO_EXCEPTIONS -I. -Isrc -I..\..\..\mkspecs\win32-msvc -Fo.obj\debug\ @C:\Users\T0187208\AppData\Local\Temp\nmF7A.tmp pcre2_auto_possess.c pcre2_chartables.c pcre2_compile.c pcre2_config.c pcre2_context.c pcre2_dfa_match.c pcre2_error.c pcre2_find_bracket.c pcre2_jit_compile.c pcre2_maketables.c pcre2_match.c pcre2_match_data.c pcre2_newline.c pcre2_ord2utf.c pcre2_pattern_info.c pcre2_serialize.c pcre2_string_utils.c pcre2_study.c pcre2_substitute.c pcre2_substring.c Generating Code... Compiling... pcre2_tables.c pcre2_ucd.c pcre2_valid_utf.c pcre2_xclass.c Generating Code... lib /NOLOGO /OUT:..\..\..\lib\qtpcre2d.lib @C:\Users\T0187208\AppData\Local\Temp\nm1B7D.tmp cd corelib\ && ( if not exist Makefile C:\QT\qt-everywhere-src-5.10.1\qtbase\bin\qmake.exe -o Makefile C:\QT\qt-everywhere-src-5.10.1\qtbase\src\corelib\corelib.pro ) && "C:\Program Files (x86 )\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f Makefile ASSERT: "isAbsolutePath(baseDir)" in file C:\QT\qt-everywhere-src-5.10.1\qtbase\qmake\library\ioutils.cpp, line 106 NMAKE : fatal error U1077: 'cd' : return code '0x3' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop. NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.
This is omitting some of the previous command line output that all worked correctly, this is where it crashed.
Do you have any idea?
-
So part of the problem was that my default prefix for the configure command was incorrect.
So going back and running the following worked.
configure -debug -nomake examples -nomake tests -skip qtwebengine -opensource -static -prefix C:\QT\qt-everywhere-src-5.10.1 -redo -recheck-all
Then to Build
nmake
-
Super good work.
Thanks for updating on the way. will be helpful for others.