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. Building Qt6.8.1 from source - Finds MSVC 19 then fails 'Check for working CXX compiler: broken' (Note: MSVC 17 only shown in QtCreator)
QtWS25 Last Chance

Building Qt6.8.1 from source - Finds MSVC 19 then fails 'Check for working CXX compiler: broken' (Note: MSVC 17 only shown in QtCreator)

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 307 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.
  • B Offline
    B Offline
    Ben Campbell-Wallis
    wrote on last edited by Ben Campbell-Wallis
    #1

    Hi,

    So I'm in a situation where I've previously built Qt6.8.1 for windows using MSVC (components installed from Visual Studio 2022 installer).

    However my machine had failed windows 11 update meaning a wipe and clean install of a lot of programs to fix numerous issues on the PC.

    Fast-forward to now, I'm wanting to rebuild Qt6.8.1 with both debug and release versions after completing my applications upgrade to Qt6 from Qt5.

    However I now encounter the below issue:

    1ecae0d5-651a-465e-8444-dab760a81f32-image.png

    What I find odd was initially I had the issue where cmake couldn't find the compiler/linker ( as describer here -> https://forum.qt.io/topic/146823/the-cxx-compiler-identification-is-unknown ).
    I added the compiler/linker to my system path to get around this (though I don't recall having to do this initially).
    PATH -> C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64

    I then checked my visual studio install options, which seem to include what I believe is needed:
    e24ab993-319b-4874-9cfe-e3f11ec185cf-image.png

    What's odd is I can build my updated project with the Qt6.8.1 kit which uses my previously built from source 6.8.1 libs - Below is my kit from QtCreator:

    8a5d5fc1-9250-4d3a-92af-d47f1a0a12bd-image.png

    I'm sure I'm missing something simple here,

    • Why does QtCreator show MSVC 17 when I don't see this version when running cmake from the terminal (it shows MSVC 19 - note running cl only shows one compiler)?

    • Is there anything obviously wrong/missing with the C++ build components in the VS installer?

    • Anybody else experienced the same issue and point me to a solution?

    Thanks in advance.

    jsulmJ 1 Reply Last reply
    0
    • B Ben Campbell-Wallis

      Hi,

      So I'm in a situation where I've previously built Qt6.8.1 for windows using MSVC (components installed from Visual Studio 2022 installer).

      However my machine had failed windows 11 update meaning a wipe and clean install of a lot of programs to fix numerous issues on the PC.

      Fast-forward to now, I'm wanting to rebuild Qt6.8.1 with both debug and release versions after completing my applications upgrade to Qt6 from Qt5.

      However I now encounter the below issue:

      1ecae0d5-651a-465e-8444-dab760a81f32-image.png

      What I find odd was initially I had the issue where cmake couldn't find the compiler/linker ( as describer here -> https://forum.qt.io/topic/146823/the-cxx-compiler-identification-is-unknown ).
      I added the compiler/linker to my system path to get around this (though I don't recall having to do this initially).
      PATH -> C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.43.34808\bin\Hostx64\x64

      I then checked my visual studio install options, which seem to include what I believe is needed:
      e24ab993-319b-4874-9cfe-e3f11ec185cf-image.png

      What's odd is I can build my updated project with the Qt6.8.1 kit which uses my previously built from source 6.8.1 libs - Below is my kit from QtCreator:

      8a5d5fc1-9250-4d3a-92af-d47f1a0a12bd-image.png

      I'm sure I'm missing something simple here,

      • Why does QtCreator show MSVC 17 when I don't see this version when running cmake from the terminal (it shows MSVC 19 - note running cl only shows one compiler)?

      • Is there anything obviously wrong/missing with the C++ build components in the VS installer?

      • Anybody else experienced the same issue and point me to a solution?

      Thanks in advance.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Ben-Campbell-Wallis Why do you use MinGW terminal if you're using MSVC compiler? Use the correct MSVC terminal which is preconfigured to use that compiler.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • B Offline
        B Offline
        Ben Campbell-Wallis
        wrote on last edited by
        #3

        @jsulm - It's the git bash terminal, which I previously used to build the same version of the sources, see:

        https://forum.qt.io/topic/160632/qt6-8-1-building-from-source-unable-to-remove-file-error-32-the-process-cannot-access-the-file-because-it-is-being-used-by-another-process/9?_=1737130253689

        I will try it using the native tools command prompt...

        1 Reply Last reply
        0
        • B Offline
          B Offline
          Ben Campbell-Wallis
          wrote on last edited by
          #4

          @jsulm update: So it does indeed configure with success and is now building as we speak.
          It's not immediately obvious to me why this worked in the past using the git bash terminal as I don't recall using the native terminal.

          I will mark your reply as a solution (and I'm glad it was as simple as using the x64 native command prompt).
          Any thought on this welcome.

          jsulmJ 1 Reply Last reply
          0
          • B Ben Campbell-Wallis has marked this topic as solved on
          • B Ben Campbell-Wallis

            @jsulm update: So it does indeed configure with success and is now building as we speak.
            It's not immediately obvious to me why this worked in the past using the git bash terminal as I don't recall using the native terminal.

            I will mark your reply as a solution (and I'm glad it was as simple as using the x64 native command prompt).
            Any thought on this welcome.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Ben-Campbell-Wallis said in Building Qt6.8.1 from source - Finds MSVC 19 then fails 'Check for working CXX compiler: broken' (Note: MSVC 17 only shown in QtCreator):

            It's not immediately obvious to me why this worked in the past

            As far as I can see you used MinGW in the past, not MSVC.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            B 1 Reply Last reply
            0
            • jsulmJ jsulm

              @Ben-Campbell-Wallis said in Building Qt6.8.1 from source - Finds MSVC 19 then fails 'Check for working CXX compiler: broken' (Note: MSVC 17 only shown in QtCreator):

              It's not immediately obvious to me why this worked in the past

              As far as I can see you used MinGW in the past, not MSVC.

              B Offline
              B Offline
              Ben Campbell-Wallis
              wrote on last edited by
              #6

              @jsulm On closer review of my past compiling issues I see you're correct. My memory failed me this time, however the conclusion was that the error was between the keyboard and chair.
              Thanks for the reply and pointing out the 'wood through the trees'.

              1 Reply Last reply
              2

              • Login

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