Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Issues building on Windows (win32-msvc)
Forum Updated to NodeBB v4.3 + New Features

Issues building on Windows (win32-msvc)

Scheduled Pinned Locked Moved Solved Qt 6
10 Posts 3 Posters 1.4k Views 2 Watching
  • 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.
  • Y Offline
    Y Offline
    Yaram
    wrote on last edited by
    #1

    I've been having trouble building QT6 on Windows with MSVC.
    Here's my setup:

    • Windows 10 19043.1110
    • Visual studio 2019 16.10.4/MSVC 14.29.30037 and 16.11.2/MSVC 14.29.30133 tried
    • CMake 3.21.2 and 3.18.6 tried
    • Strawberry Perl 5.32.1001
    • Python 3.8.150.0
    • qtbase repo 6.0.4 and 6.1.3 tried as well as qt-everywhere-src 6.0.4

    The same issue has manifested on each version/combination

    I get the following error message (or similar) each time I try to build:

    [1/1629] Building RC object src\corelib\CMakeFiles\Core_rc.dir\Core_resource.rc.res
    FAILED: src/corelib/CMakeFiles/Core_rc.dir/Core_resource.rc.res
    "C:/Program Files/CMake/bin/cmcldeps.exe" RC C:\Users\Yaram\thirdparty\qtbase-6.0.4\src\corelib\Core_resource.rc src\corelib\CMakeFiles\Core_rc.dir\Core_resource.rc.res.d src\corelib\CMakeFiles\Core_rc.dir\Core_resource.rc.res "Note: including file: " "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe   -DWIN32 -D_DEBUG /fo src\corelib\CMakeFiles\Core_rc.dir\Core_resource.rc.res C:\Users\Yaram\thirdparty\qtbase-6.0.4\src\corelib\Core_resource.rc
    'C:/Program' is not recognized as an internal or external command,
    operable program or batch file.
    [10/1629] Building CXX object src\tools\bootstrap\CMakeFiles\Bootstrap.dir\__\__\corelib\text\qstring.cpp.obj
    ninja: build stopped: subcommand failed.
    

    My build procedure is:

    • extract source zip
    • open Visual Studio 2019 x64 native tools prompt
    • cd to source directory
    • run configure
    • run cmake --build .

    From the nature of the error message, could be an issue with unescaped quotes in the CMake scripts?
    Definitely would appreciate any help on this one!

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      Yaram
      wrote on last edited by
      #2

      Just a small update, I've confirmed that cmcldeps.exe is never ran.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        I would install cmake in a path without space.

        On a side note, you should use out of source builds. It will avoid polluting the sources with build artifacts to remove if you want to rebuild with a different set of options.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • Y Offline
          Y Offline
          Yaram
          wrote on last edited by
          #4

          Hey, thanks for the reply!

          The directory I'm building in has no spaces in it's path, and as far as I'm aware the set install path shouldn't matter prior to running cmake --install .? Either way I've tried building with configure -prefix C:/qt6, and had the same issue.

          I was using an out-of-source-tree build originally, but after running into this issue, I switched to an in-source-tree build as a troubleshooting step to reduce the number of differences between my build steps and the ones described in the documentation here.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            It's cmcldeps.exe that is in a path with spaces. Hence my suggestion to install cmake in a path without spaces.

            By the way, how did you install it ?

            Qt proposes it and it should be installed along the other tools under the Qt folder.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • Y Offline
              Y Offline
              Yaram
              wrote on last edited by Yaram
              #6

              Ah, I apologise, I misread your reply.

              Installing CMake into a path without a space has changed the error message to The filename, directory name, or volume label syntax is incorrect., the rest of the message is identical, save for the different CMake path. Also confirmed again that cmcldeps.exe is still never ran, so I believe this is a manifestation of the same underlying issue.

              I installed CMake from the official installer.

              I think I might build CMake from source and have a look at what's going on internally.

              1 Reply Last reply
              0
              • Y Offline
                Y Offline
                Yaram
                wrote on last edited by
                #7

                I've recreated the bug with a simple test project, it appears this is a general issue with CMake, Ninja, and MSVC, and is not unique to Qt. After a bit of poking around the CMake source I might create a issue on CMake issue tracker for this issue.

                1 Reply Last reply
                0
                • Y Offline
                  Y Offline
                  Yaram
                  wrote on last edited by
                  #8

                  This issue has been fixed in CMake PR 6502 and the fix will be present in CMake version 3.22.0 when it is released.

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MrShawn
                    wrote on last edited by
                    #9

                    Did you install CMake with the Qt maintenance tool? I'm betting that you did not due to the CMake directory. I suggest opening the Qt maintenance tool and doing that. it will place it right into your Qt dir and then you can configure your kits to use that CMake instead.

                    Basically what SGaist has said.

                    1 Reply Last reply
                    0
                    • Y Offline
                      Y Offline
                      Yaram
                      wrote on last edited by Yaram
                      #10

                      That is certainly a good solution for others with this problem, but I'm using Qt as a vendored dependency with add_subdirectory and system CMake in a project of mine, so that solution doesn't work for me.

                      I've marked the topic as solved, as there is now a solution for my use case and others.

                      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