<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Qt 6.3.2 compilation issue]]></title><description><![CDATA[<p dir="auto">I want to build <code>Qt 6.3.2</code> but it has a lot of issues during the compilation process.</p>
<p dir="auto">I use the following libs to build with Qt:</p>
<ol>
<li>MySQL (mysql-8.0.30)</li>
<li>OpenSSL (openssl-1.1.1q)</li>
<li>Zlib (zlib-win-build-1.2.12)</li>
</ol>
<p dir="auto"><strong>My cmake batch command:</strong></p>
<pre><code>cmake.exe --trace-expand --trace-redirect=cmake.trace -DCMAKE_BUILD_TYPE=%qtBuildMode% -DBUILD_SHARED_LIBS=OFF -DQT_BUILD_EXAMPLES=OFF -DCMAKE_PREFIX_PATH="C:\\LLVM\\x64\\static\\debug;" -DZLIB_INCLUDE_DIR="C:\\ZipDev\\zlib-win-build-1.2.12" -DZLIB_LIBRARY="C:\\ZipDev\\zlib-win-build-1.2.12\\build-VS2022-MT\\x64\\Debug\\libz-static.lib" -DZLIB_USE_STATIC_LIBS=ON -DINPUT_static_runtime=ON -DFEATURE_ltcg=OFF -DBUILD_qtwebengine=OFF -DOPENSSL_ROOT_DIR="%qtBuildOpenSSLRootPath%" -DFEATURE_openssl_linked=ON -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_MSVC_STATIC_RT=TRUE -DINPUT_sql_mysql=ON -DMySQL_INCLUDE_DIR="%qtBuildMySqlIncludeDirsPath%" -DMySQL_LIBRARY="%qtBuildMySqlLibsPath%" -DCMAKE_INSTALL_PREFIX="%qtBuildPath%" -G Ninja %qtBuildSourcePath%
</code></pre>
<p dir="auto">I have fixed many of them but still need to fix this one.</p>
<pre><code>[7197/9220] Linking CXX executable qtbase\bin\assistant.exe
FAILED: qtbase/bin/assistant.exe
cmd.exe /C "cd . &amp;&amp; "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=qttools\src\assistant\assistant\CMakeFiles\assistant.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~3\2019\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\assistant.rsp  /out:qtbase\bin\assistant.exe /implib:qttools\src\assistant\assistant\assistant.lib /pdb:qtbase\bin\assistant.pdb /version:0.0 /machine:x64 /debug /subsystem:windows  -DYNAMICBASE -NXCOMPAT -LARGEADDRESSAWARE  &amp;&amp; cd ."
LINK: command "C:\PROGRA~2\MICROS~3\2019\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\assistant.rsp /out:qtbase\bin\assistant.exe /implib:qttools\src\assistant\assistant\assistant.lib /pdb:qtbase\bin\assistant.pdb /version:0.0 /machine:x64 /debug /subsystem:windows -DYNAMICBASE -NXCOMPAT -LARGEADDRESSAWARE /MANIFEST /MANIFESTFILE:qtbase\bin\assistant.exe.manifest" failed (exit code 1120) with the following output:
   Creating library qttools\src\assistant\assistant\assistant.lib and object qttools\src\assistant\assistant\assistant.exp
mysqlclientMTd.lib(charset.obj) : error LNK2019: unresolved external symbol __std_init_once_link_alternate_names_and_abort referenced in function "void __cdecl std::call_once&lt;void (__cdecl&amp;)(void)&gt;(struct std::once_flag &amp;,void (__cdecl&amp;)(void))" (??$call_once@A6AXXZ$$V@std@@YAXAEAUonce_flag@0@A6AXXZ@Z)
mysqlclientMTd.lib(my_malloc.obj) : error LNK2001: unresolved external symbol __std_init_once_link_alternate_names_and_abort
qtbase\bin\assistant.exe : fatal error LNK1120: 1 unresolved externals
[7206/9220] Building CXX object qttools\src\designer\src\designer\CMakeFiles\designer.dir\cmake_pch.cxx.obj
ninja: build stopped: subcommand failed.
</code></pre>
<p dir="auto">Any ideas what could cause such error? Thank you.</p>
]]></description><link>https://forum.qt.io/topic/139376/qt-6-3-2-compilation-issue</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 08:10:04 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/139376.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 Sep 2022 20:20:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qt 6.3.2 compilation issue on Sat, 17 Sep 2022 19:06:41 GMT]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">This issue with <code>mysqlclientMTd.lib</code> occurs due to the mismatch beween compiler versions as described here: <a href="https://developercommunity.visualstudio.com/t/__imp___std_init_once_complete-unresolve/1684365" target="_blank" rel="noopener noreferrer nofollow ugc">https://developercommunity.visualstudio.com/t/__imp___std_init_once_complete-unresolve/1684365</a>. This library was compiled with <code>Visual Studio 2022</code> compiler.<br />
I used <code>x64 Native Tools Command Prompt for VS 2019</code> to build <code>Qt 6.3.2</code> which means it could not find this new function: <code>__std_init_once_link_alternate_names_and_abort</code>. This function is from STL’s import library: <code>msvcprt.lib</code> and was only added in the <code>VS 2022</code> version: <strong>17.2.5</strong>.  So, I fixed this error by rebuilding this <code>mysqlclientMTd.lib</code> for <code>VS 2019</code> compiler, since I need <code>Qt 6.3.2</code> for <code>VS 2019</code> compiler.</p>
<p dir="auto">Also, I have got another error, at this time with <code>libz-static.lib</code> in Release build:</p>
<pre><code>C:\QtBuild\qt-everywhere-src-6.3.2&gt;cmake --build .
[792/9220] Linking CXX executable qtbase\bin\rcc.exe
FAILED: qtbase/bin/rcc.exe
cmd.exe /C "cd . &amp;&amp; "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=qtbase\src\tools\rcc\CMakeFiles\rcc.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~3\2019\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo qtbase\src\tools\rcc\CMakeFiles\rcc.dir\rcc_autogen\mocs_compilation.cpp.obj qtbase\src\tools\rcc\CMakeFiles\rcc.dir\rcc_resource.rc.res qtbase\src\tools\rcc\CMakeFiles\rcc.dir\main.cpp.obj qtbase\src\tools\rcc\CMakeFiles\rcc.dir\rcc.cpp.obj  /out:qtbase\bin\rcc.exe /implib:qtbase\src\tools\rcc\rcc.lib /pdb:qtbase\bin\rcc.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console  -DYNAMICBASE -NXCOMPAT -LARGEADDRESSAWARE -OPT:REF -OPT:ICF -GUARD:CF  qtbase\lib\Qt6Core.lib  qtbase\lib\Qt6Core.lib  C:\\ZipDev\\zlib-win-build-1.2.12\\build-VS2022-MT\\x64\\Release\\libz-static.lib  synchronization.lib  mpr.lib  userenv.lib  advapi32.lib  authz.lib  kernel32.lib  netapi32.lib  ole32.lib  shell32.lib  user32.lib  uuid.lib  version.lib  winmm.lib  ws2_32.lib  runtimeobject.lib  qtbase\lib\Qt6BundledPcre2.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib &amp;&amp; cd ."
LINK: command "C:\PROGRA~2\MICROS~3\2019\ENTERP~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo qtbase\src\tools\rcc\CMakeFiles\rcc.dir\rcc_autogen\mocs_compilation.cpp.obj qtbase\src\tools\rcc\CMakeFiles\rcc.dir\rcc_resource.rc.res qtbase\src\tools\rcc\CMakeFiles\rcc.dir\main.cpp.obj qtbase\src\tools\rcc\CMakeFiles\rcc.dir\rcc.cpp.obj /out:qtbase\bin\rcc.exe /implib:qtbase\src\tools\rcc\rcc.lib /pdb:qtbase\bin\rcc.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console -DYNAMICBASE -NXCOMPAT -LARGEADDRESSAWARE -OPT:REF -OPT:ICF -GUARD:CF qtbase\lib\Qt6Core.lib qtbase\lib\Qt6Core.lib C:\\ZipDev\\zlib-win-build-1.2.12\\build-VS2022-MT\\x64\\Release\\libz-static.lib synchronization.lib mpr.lib userenv.lib advapi32.lib authz.lib kernel32.lib netapi32.lib ole32.lib shell32.lib user32.lib uuid.lib version.lib winmm.lib ws2_32.lib runtimeobject.lib qtbase\lib\Qt6BundledPcre2.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:qtbase\bin\rcc.exe.manifest" failed (exit code 1257) with the following output:
libz-static.lib(compress.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
fatal error C1900: Il mismatch between 'P1' version '20211014' and 'P2' version '20210202'
LINK : fatal error LNK1257: code generation failed
[800/9220] Automatic MOC for target Network
AutoMoc: C:/QtBuild/qt-everywhere-src-6.3.2/qtbase/src/network/access/qnetworkaccessdebugpipebackend_p.h(0:1): note: No relevant classes found. No output generated.
[801/9220] Building CXX object qtbase\src\tools\qlalr\CMakeFiles\qlalr.dir\cppgenerator.cpp.obj
ninja: build stopped: subcommand failed.

C:\QtBuild\qt-everywhere-src-6.3.2&gt;
</code></pre>
<p dir="auto">So, to fix this error: <code>fatal error C1900: Il mismatch between 'P1' version '20211014' and 'P2' version '20210202'</code>, I have to build the <code>libz-static.lib</code> for <code>VS 2019</code> compiler as well. Now, everything compiles (debug/release) without any error. The issue is resolved.</p>
]]></description><link>https://forum.qt.io/post/729127</link><guid isPermaLink="true">https://forum.qt.io/post/729127</guid><dc:creator><![CDATA[Cobra91151]]></dc:creator><pubDate>Sat, 17 Sep 2022 19:06:41 GMT</pubDate></item><item><title><![CDATA[Reply to Qt 6.3.2 compilation issue on Fri, 16 Sep 2022 22:10:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hskoglund">@<bdi>hskoglund</bdi></a>  <a class="plugin-mentions-user plugin-mentions-a" href="/user/tomz">@<bdi>TomZ</bdi></a></p>
<p dir="auto">Yes, it's a bit tricky. I think, I know how to fix this issue.<br />
I will reply tomorrow reqarding the solution. Thanks.</p>
]]></description><link>https://forum.qt.io/post/729079</link><guid isPermaLink="true">https://forum.qt.io/post/729079</guid><dc:creator><![CDATA[Cobra91151]]></dc:creator><pubDate>Fri, 16 Sep 2022 22:10:00 GMT</pubDate></item><item><title><![CDATA[Reply to Qt 6.3.2 compilation issue on Fri, 16 Sep 2022 21:11:44 GMT]]></title><description><![CDATA[<p dir="auto">I understand if you want to compile Qt, the libraries, static. But why are you building tools like assistant using that as well?</p>
<p dir="auto">If you need assistant and other tools, use the normal approach of dynamic libraries.</p>
]]></description><link>https://forum.qt.io/post/729078</link><guid isPermaLink="true">https://forum.qt.io/post/729078</guid><dc:creator><![CDATA[TomZ]]></dc:creator><pubDate>Fri, 16 Sep 2022 21:11:44 GMT</pubDate></item><item><title><![CDATA[Reply to Qt 6.3.2 compilation issue on Fri, 16 Sep 2022 21:09:02 GMT]]></title><description><![CDATA[<p dir="auto">Hi, building a static Qt in Debug mode is tricky, you could try a Release mode build.</p>
]]></description><link>https://forum.qt.io/post/729077</link><guid isPermaLink="true">https://forum.qt.io/post/729077</guid><dc:creator><![CDATA[hskoglund]]></dc:creator><pubDate>Fri, 16 Sep 2022 21:09:02 GMT</pubDate></item></channel></rss>