Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMake trace issue
Forum Updated to NodeBB v4.3 + New Features

QMake trace issue

Scheduled Pinned Locked Moved Solved General and Desktop
14 Posts 3 Posters 837 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Cobra91151C Offline
    Cobra91151C Offline
    Cobra91151
    wrote on last edited by
    #4

    @JonB

    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 of jom, but nmake will take a lot of time to compile.

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #5

      Call nmake to see the actual error (or jom -j1 which is basically the same).

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      Cobra91151C 2 Replies Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher

        Call nmake to see the actual error (or jom -j1 which is basically the same).

        Cobra91151C Offline
        Cobra91151C Offline
        Cobra91151
        wrote on last edited by
        #6

        @Christian-Ehrlicher

        Ok. I will try it. Thank you.

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          Call nmake to see the actual error (or jom -j1 which is basically the same).

          Cobra91151C Offline
          Cobra91151C Offline
          Cobra91151
          wrote on last edited by Cobra91151
          #7

          @Christian-Ehrlicher

          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 use x86 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 why std::min could lead to this error? Thanks.

          Christian EhrlicherC 1 Reply Last reply
          0
          • Cobra91151C Cobra91151

            @Christian-Ehrlicher

            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 use x86 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 why std::min could lead to this error? Thanks.

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #8

            @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.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            Cobra91151C 2 Replies Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @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.

              Cobra91151C Offline
              Cobra91151C Offline
              Cobra91151
              wrote on last edited by Cobra91151
              #9

              @Christian-Ehrlicher

              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 until RC_INVOKED is defined. I will try again to build Qt 5.15.6. Thanks.

              1 Reply Last reply
              0
              • Christian EhrlicherC Christian Ehrlicher

                @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.

                Cobra91151C Offline
                Cobra91151C Offline
                Cobra91151
                wrote on last edited by
                #10

                @Christian-Ehrlicher

                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.

                1 Reply Last reply
                0
                • Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #11

                  What msvc version do you use? 2022? Not sure if 5.15.6 already has all patches for this compiler though.

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  Cobra91151C 1 Reply Last reply
                  0
                  • Christian EhrlicherC Christian Ehrlicher

                    What msvc version do you use? 2022? Not sure if 5.15.6 already has all patches for this compiler though.

                    Cobra91151C Offline
                    Cobra91151C Offline
                    Cobra91151
                    wrote on last edited by Cobra91151
                    #12

                    @Christian-Ehrlicher

                    No. I use VS 2019 compiler - x86 Native Tools Command Prompt for VS 2019. It uses Windows 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.

                    1 Reply Last reply
                    0
                    • Cobra91151C Offline
                      Cobra91151C Offline
                      Cobra91151
                      wrote on last edited by Cobra91151
                      #13

                      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. Set LLVM_INSTALL_DIR to the Win32 libs, since I build Qt for x86 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 to Python: C:\Program Files\Python. I have installed the Python without spaces in the path, for example: C:\Python to fix this error.

                      Trying again...

                      1 Reply Last reply
                      0
                      • Cobra91151C Offline
                        Cobra91151C Offline
                        Cobra91151
                        wrote on last edited by Cobra91151
                        #14

                        Hello!

                        I have successfully built the Qt 5.15.6 for VS 2019 / 2022 for x86/x64 architecture (static/shared). The issue is resolved.

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved