QMake trace issue
-
Hello!
When compiling
Qt 5.15.6
, I got the following error:Copyright (c) Microsoft Corporation. All rights reserved. Processing C:\QtBuild\qt-everywhere-src-5.15.6\qtactiveqt\tools\testcon\testcon.idl testcon.idl Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\ocidl.idl ocidl.idl Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\oleidl.idl oleidl.idl Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\objidl.idl objidl.idl Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\unknwn.idl unknwn.idl Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\wtypes.idl wtypes.idl Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\wtypesbase.idl wtypesbase.idl Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\basetsd.h basetsd.h Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\guiddef.h guiddef.h Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\oaidl.idl oaidl.idl Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\servprov.idl servprov.idl Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\urlmon.idl urlmon.idl Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\msxml.idl msxml.idl Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\oaidl.acf oaidl.acf Processing C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\ocidl.acf ocidl.acf 1 file(s) moved. jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtdeclarative\src\qml\Makefile.Debug [.generated\debug\RegExpJitTables.h] Error 1 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtdeclarative\src\qml\Makefile [debug] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtdeclarative\src\Makefile [sub-qml-make_first-ordered] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtdeclarative\Makefile [sub-src-make_first] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\Makefile [module-qtdeclarative-make_first] Error 2
So, how to get the trace ouput for this error?
-
The
configure
has an option called:-trace "yes"
.-trace [backend] ..... Enable instrumentation with tracepoints. Currently supported backends are 'etw' (Windows) and 'lttng' (Linux), or 'yes' for auto-detection. [no]
I have added it, but I got another issue:
Creating library ..\..\..\..\lib\libEGLd.lib and object ..\..\..\..\lib\libEGLd.exp copy /y ..\..\..\..\lib\libEGLd.dll ..\..\..\..\bin 1 file(s) copied. jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\Makefile [sub-corelib-make_first] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\Makefile [sub-src-make_first] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\Makefile [module-qtbase-make_first] Error 2
And no output is available or trace file exists.
I think the only way to detect this issue is to use:nmake
instead ofjom
, butnmake
will take a lot of time to compile. -
Call nmake to see the actual error (or jom -j1 which is basically the same).
-
Call nmake to see the actual error (or jom -j1 which is basically the same).
Ok. I will try it. Thank you.
-
Call nmake to see the actual error (or jom -j1 which is basically the same).
So, I have run:
jom -j1
, it leads to this issue:C:\QtBuild\qt-everywhere-src-5.15.6\qtbase\src\corelib\global\qlogging.cpp(1683): error C2589: '(': illegal token on right side of '::' C:\QtBuild\qt-everywhere-src-5.15.6\qtbase\src\corelib\global\qlogging.cpp(1683): error C2062: type 'unknown-type' unexpected C:\QtBuild\qt-everywhere-src-5.15.6\qtbase\src\corelib\global\qlogging.cpp(1683): error C2059: syntax error: ')' jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\corelib\Makefile.Debug [.obj\debug\qendian.obj] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\corelib\Makefile [debug] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\Makefile [sub-corelib-make_first] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\Makefile [sub-src-make_first] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\Makefile [module-qtbase-make_first] Error 2
Source file:
qlogging.cpp(1683):
static void win_outputDebugString_helper(QStringView message) { const int maxOutputStringLength = 32766; static QBasicMutex m; auto locker = qt_unique_lock(m); // fast path: Avoid string copies if one output is enough if (message.length() <= maxOutputStringLength) { OutputDebugString(reinterpret_cast<const wchar_t *>(message.utf16())); } else { wchar_t *messagePart = new wchar_t[maxOutputStringLength + 1]; for (int i = 0; i < message.length(); i += maxOutputStringLength ) { const int length = std::min(message.length() - i, maxOutputStringLength ); const int len = message.mid(i, length).toWCharArray(messagePart); Q_ASSERT(len == length); messagePart[len] = 0; OutputDebugString(messagePart); } delete[] messagePart; } }
So, for some reason this line (1683) leads to an error:
const int length = std::min(message.length() - i, maxOutputStringLength );
?
I usex86 Native Tools Command Prompt for VS 2019
to build Qt 5.15.6.
It seems some include is missing, so it could not find this std function. Any ideas whystd::min
could lead to this error? Thanks. -
So, I have run:
jom -j1
, it leads to this issue:C:\QtBuild\qt-everywhere-src-5.15.6\qtbase\src\corelib\global\qlogging.cpp(1683): error C2589: '(': illegal token on right side of '::' C:\QtBuild\qt-everywhere-src-5.15.6\qtbase\src\corelib\global\qlogging.cpp(1683): error C2062: type 'unknown-type' unexpected C:\QtBuild\qt-everywhere-src-5.15.6\qtbase\src\corelib\global\qlogging.cpp(1683): error C2059: syntax error: ')' jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\corelib\Makefile.Debug [.obj\debug\qendian.obj] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\corelib\Makefile [debug] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\Makefile [sub-corelib-make_first] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\Makefile [sub-src-make_first] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\Makefile [module-qtbase-make_first] Error 2
Source file:
qlogging.cpp(1683):
static void win_outputDebugString_helper(QStringView message) { const int maxOutputStringLength = 32766; static QBasicMutex m; auto locker = qt_unique_lock(m); // fast path: Avoid string copies if one output is enough if (message.length() <= maxOutputStringLength) { OutputDebugString(reinterpret_cast<const wchar_t *>(message.utf16())); } else { wchar_t *messagePart = new wchar_t[maxOutputStringLength + 1]; for (int i = 0; i < message.length(); i += maxOutputStringLength ) { const int length = std::min(message.length() - i, maxOutputStringLength ); const int len = message.mid(i, length).toWCharArray(messagePart); Q_ASSERT(len == length); messagePart[len] = 0; OutputDebugString(messagePart); } delete[] messagePart; } }
So, for some reason this line (1683) leads to an error:
const int length = std::min(message.length() - i, maxOutputStringLength );
?
I usex86 Native Tools Command Prompt for VS 2019
to build Qt 5.15.6.
It seems some include is missing, so it could not find this std function. Any ideas whystd::min
could lead to this error? Thanks.@Cobra91151 said in QMake trace issue:
Any ideas why std::min could lead to this error? Thanks.
Yes because of stupid MSVC defines
try to add
#undef min #undef max
after the
#include
statements.
But I wonder why NOMINMAX is not defined when you compile with msvc. -
@Cobra91151 said in QMake trace issue:
Any ideas why std::min could lead to this error? Thanks.
Yes because of stupid MSVC defines
try to add
#undef min #undef max
after the
#include
statements.
But I wonder why NOMINMAX is not defined when you compile with msvc.Your solution with
undef
:#undef min #undef max
will work 100%. I tested a simple project using
VS 2019
. Also, I tried to define the#define NOMINMAX
in this test project and it does nothing. Additionally, I clicked go to definition for this define and it lead me to this:Windows.h file:
#if defined(RC_INVOKED) /* Turn off a bunch of stuff to ensure that RC files compile OK. */ #define NOATOM #define NOGDI #define NOGDICAPMASKS #define NOMETAFILE #define NOMINMAX #define NOMSG #define NOOPENFILE #define NORASTEROPS #define NOSCROLL #define NOSOUND #define NOSYSMETRICS #define NOTEXTMETRIC #define NOWH #define NOCOMM #define NOKANJI #define NOCRYPT #define NOMCX #endif
So, it seems that
#define NOMINMAX
will not work untilRC_INVOKED
is defined. I will try again to build Qt 5.15.6. Thanks. -
@Cobra91151 said in QMake trace issue:
Any ideas why std::min could lead to this error? Thanks.
Yes because of stupid MSVC defines
try to add
#undef min #undef max
after the
#include
statements.
But I wonder why NOMINMAX is not defined when you compile with msvc.It's strange, I got a lot of errors:
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\TraceLoggingProvider.h(3665): error C2338: The type is not supported by TraceLoggingValue. (compiling source file C:\QtBuild\qt-everywhere-src-5.15.6\qtbase\src\gui\image\qimagereader.cpp) C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\TraceLoggingProvider.h(3669): note: see reference to class template instantiation '_tlgTypeMapBase<QSize>' being compiled (compiling source file C:\QtBuild\qt-everywhere-src-5.15.6\qtbase\src\gui\image\qimagereader.cpp) C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\gui\.tracegen\debug\qtgui_tracepoints_p.h(168): note: see reference to class template instantiation '_tlgTypeMap<const QSize &>' being compiled (compiling source file C:\QtBuild\qt-everywhere-src-5.15.6\qtbase\src\gui\image\qimagereader.cpp) C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\gui\.tracegen\debug\qtgui_tracepoints_p.h(168): error C2039: '_tlgTypeType0': is not a member of '_tlgTypeMap<const QSize &>' (compiling source file C:\QtBuild\qt-everywhere-src-5.15.6\qtbase\src\gui\image\qimagereader.cpp) ......... C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\gui\.tracegen\debug\qtgui_tracepoints_p.h(435): error C2078: too many initializers (compiling source file C:\QtBuild\qt-everywhere-src-5.15.6\qtbase\src\gui\image\qpixmap.cpp) jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\gui\Makefile.Debug [.obj\debug\qbitmap.obj] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\gui\Makefile [debug] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\src\Makefile [sub-gui-make_first] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\qtbase\Makefile [sub-src-make_first] Error 2 jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild\Makefile [module-qtbase-make_first] Error 2 C:\QtBuild\qt-everywhere-src-5.15.6\qtBuild>
Any suggestions? Thanks.
-
What msvc version do you use? 2022? Not sure if 5.15.6 already has all patches for this compiler though.
-
What msvc version do you use? 2022? Not sure if 5.15.6 already has all patches for this compiler though.
No. I use
VS 2019
compiler -x86 Native Tools Command Prompt for VS 2019
. It usesWindows Kits\10\include\10.0.22000.0
. Maybe the problem is with the latest kit?Also, I have removed the
-trace "yes"
from configure command, I think it could lead to such errors. -
Ok. So,
-trace "yes"
command leads to this error. By removing this command, the compilation continues until I got the mismatch between the LLVM libs.
I have downloaded them from https://github.com/llvm/llvm-project/releases/tag/llvmorg-14.0.6 for LLVM-14.0.6-win32.exe & LLVM-14.0.6-win64.exe binaries, installed them. SetLLVM_INSTALL_DIR
to the Win32 libs, since I build Qt forx86 Native Tools Command Prompt for VS 2019
.By the way, this error:
jom: C:\QtBuild\qt-everywhere-src-5.15.6\qtdeclarative\src\qml\Makefile.Debug [.generated\debug\RegExpJitTables.h] Error 1
occurs due to the space in the path toPython
:C:\Program Files\Python
. I have installed thePython
without spaces in the path, for example:C:\Python
to fix this error.Trying again...
-
Hello!
I have successfully built the
Qt 5.15.6
forVS 2019 / 2022
for x86/x64 architecture (static/shared). The issue is resolved.