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. Error while Building Qt 6.8.2 from Source

Error while Building Qt 6.8.2 from Source

Scheduled Pinned Locked Moved Unsolved General and Desktop
14 Posts 3 Posters 447 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.
  • D Offline
    D Offline
    dan1973
    wrote on last edited by
    #4

    The C++ compiler

    "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe"
    

    is not able to compile a simple test program.

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

      Please post the full output. Above you are not using 2022. Make sure to use a clean build dir and the correct visual studio command prompt.

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

      D 1 Reply Last reply
      0
      • D dan1973

        The C++ compiler

        "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe"
        

        is not able to compile a simple test program.

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

        @dan1973 Do you use the preconfigured MSVC terminal?

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

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          Please post the full output. Above you are not using 2022. Make sure to use a clean build dir and the correct visual studio command prompt.

          D Offline
          D Offline
          dan1973
          wrote on last edited by dan1973
          #7

          @Christian-Ehrlicher
          D:\Dev\Qt\src>configure -debug-and-release

          • D:\Dev\Qt\src/qtbase/configure.bat -top-level -debug-and-release
            -- Windows 10 SDK version:
            'C:/Program Files/CMake/bin/cmake.exe' '-DQT_INTERNAL_CALLED_FROM_CONFIGURE:BOOL=TRUE' '-DCMAKE_CONFIGURATION_TYPES=Release;Debug' '-G' 'Ninja Multi-Config' 'D:/Dev/Qt/src'
            -- The CXX compiler identification is MSVC 19.35.32217.1
            -- The C compiler identification is MSVC 19.35.32217.1
            -- The ASM compiler identification is MSVC
            -- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
            -- Detecting CXX compiler ABI info
            -- Detecting CXX compiler ABI info - failed
            -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
            -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - broken
            CMake Error at C:/Program Files/CMake/share/cmake-4.0/Modules/CMakeTestCXXCompiler.cmake:73 (message):
            The C++ compiler

            "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe"

            is not able to compile a simple test program.

            It fails with the following output:

            Change Dir: 'D:/Dev/Qt/src/CMakeFiles/CMakeScratch/TryCompile-uw7b8x'

            Run Build Command(s): C:/PROGRA~1/Ninja/ninja.exe -v -f build-Release.ninja cmTC_81e20
            [1/2] C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\cl.exe /nologo /TP -DCMAKE_INTDIR="Release" /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -MD /showIncludes /FoCMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /FdCMakeFiles\cmTC_81e20.dir\Release\ /FS -c D:\Dev\Qt\src\CMakeFiles\CMakeScratch\TryCompile-uw7b8x\testCXXCompiler.cxx
            [2/2] C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --msvc-ver=1935 --intdir=CMakeFiles\cmTC_81e20.dir\Release --rc=C:\PROGRA~2\MICROS~3\COMMON\MSDev98\Bin\RC.EXE --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /out:Release\cmTC_81e20.exe /implib:Release\cmTC_81e20.lib /pdb:Release\cmTC_81e20.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
            FAILED: Release/cmTC_81e20.exe
            C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --msvc-ver=1935 --intdir=CMakeFiles\cmTC_81e20.dir\Release --rc=C:\PROGRA~2\MICROS~3\COMMON\MSDev98\Bin\RC.EXE --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /out:Release\cmTC_81e20.exe /implib:Release\cmTC_81e20.lib /pdb:Release\cmTC_81e20.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
            LINK: command "C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /out:Release\cmTC_81e20.exe /implib:Release\cmTC_81e20.lib /pdb:Release\cmTC_81e20.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1" failed (exit code 1327) with the following output:

            RC : fatal error RC1106 : invalid option: -ologo

            LINK : fatal error LNK1327: failure during running rc.exe
            ninja: build stopped: subcommand failed.

            CMake will not be able to correctly generate this project.
            Call Stack (most recent call first):
            CMakeLists.txt:15 (project)

          -- Configuring incomplete, errors occurred!
          CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:1139 (message):
          CMake exited with code 1.

          CMake Error at cmake/QtIRProcessHelpers.cmake:173 (message):
          D:\Dev\Qt\src/qtbase/configure.bat -top-level -debug-and-release exited
          with status: 1

          Call Stack (most recent call first):
          cmake/QtTopLevelHelpers.cmake:35 (qt_ir_execute_process_and_log_and_handle_error)
          cmake/QtTopLevelHelpers.cmake:57 (qt_tl_run_toplevel_configure)
          cmake/QtTopLevelConfigureScript.cmake:17 (qt_tl_run_main_script)

          D:\Dev\Qt\src>

          ///////////
          i had set "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64" this path to my System Environment "Path" variable

          Christian EhrlicherC 1 Reply Last reply
          0
          • D dan1973

            @Christian-Ehrlicher
            D:\Dev\Qt\src>configure -debug-and-release

            • D:\Dev\Qt\src/qtbase/configure.bat -top-level -debug-and-release
              -- Windows 10 SDK version:
              'C:/Program Files/CMake/bin/cmake.exe' '-DQT_INTERNAL_CALLED_FROM_CONFIGURE:BOOL=TRUE' '-DCMAKE_CONFIGURATION_TYPES=Release;Debug' '-G' 'Ninja Multi-Config' 'D:/Dev/Qt/src'
              -- The CXX compiler identification is MSVC 19.35.32217.1
              -- The C compiler identification is MSVC 19.35.32217.1
              -- The ASM compiler identification is MSVC
              -- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
              -- Detecting CXX compiler ABI info
              -- Detecting CXX compiler ABI info - failed
              -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
              -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - broken
              CMake Error at C:/Program Files/CMake/share/cmake-4.0/Modules/CMakeTestCXXCompiler.cmake:73 (message):
              The C++ compiler

              "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe"

              is not able to compile a simple test program.

              It fails with the following output:

              Change Dir: 'D:/Dev/Qt/src/CMakeFiles/CMakeScratch/TryCompile-uw7b8x'

              Run Build Command(s): C:/PROGRA~1/Ninja/ninja.exe -v -f build-Release.ninja cmTC_81e20
              [1/2] C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\cl.exe /nologo /TP -DCMAKE_INTDIR="Release" /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -MD /showIncludes /FoCMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /FdCMakeFiles\cmTC_81e20.dir\Release\ /FS -c D:\Dev\Qt\src\CMakeFiles\CMakeScratch\TryCompile-uw7b8x\testCXXCompiler.cxx
              [2/2] C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --msvc-ver=1935 --intdir=CMakeFiles\cmTC_81e20.dir\Release --rc=C:\PROGRA~2\MICROS~3\COMMON\MSDev98\Bin\RC.EXE --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /out:Release\cmTC_81e20.exe /implib:Release\cmTC_81e20.lib /pdb:Release\cmTC_81e20.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
              FAILED: Release/cmTC_81e20.exe
              C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --msvc-ver=1935 --intdir=CMakeFiles\cmTC_81e20.dir\Release --rc=C:\PROGRA~2\MICROS~3\COMMON\MSDev98\Bin\RC.EXE --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /out:Release\cmTC_81e20.exe /implib:Release\cmTC_81e20.lib /pdb:Release\cmTC_81e20.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
              LINK: command "C:\PROGRA~1\MICROS~4\2022\PROFES~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_81e20.dir\Release\testCXXCompiler.cxx.obj /out:Release\cmTC_81e20.exe /implib:Release\cmTC_81e20.lib /pdb:Release\cmTC_81e20.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1" failed (exit code 1327) with the following output:

              RC : fatal error RC1106 : invalid option: -ologo

              LINK : fatal error LNK1327: failure during running rc.exe
              ninja: build stopped: subcommand failed.

              CMake will not be able to correctly generate this project.
              Call Stack (most recent call first):
              CMakeLists.txt:15 (project)

            -- Configuring incomplete, errors occurred!
            CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:1139 (message):
            CMake exited with code 1.

            CMake Error at cmake/QtIRProcessHelpers.cmake:173 (message):
            D:\Dev\Qt\src/qtbase/configure.bat -top-level -debug-and-release exited
            with status: 1

            Call Stack (most recent call first):
            cmake/QtTopLevelHelpers.cmake:35 (qt_ir_execute_process_and_log_and_handle_error)
            cmake/QtTopLevelHelpers.cmake:57 (qt_tl_run_toplevel_configure)
            cmake/QtTopLevelConfigureScript.cmake:17 (qt_tl_run_main_script)

            D:\Dev\Qt\src>

            ///////////
            i had set "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64" this path to my System Environment "Path" variable

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

            @dan1973 said in Error while Building Qt 6.8.2 from Source:

            i had set "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64" this path to my System Environment "Path" variable

            This is wrong. Use the correct visual studio command prompt from your start menu as we already told you...

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

            D 1 Reply Last reply
            2
            • Christian EhrlicherC Christian Ehrlicher

              @dan1973 said in Error while Building Qt 6.8.2 from Source:

              i had set "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64" this path to my System Environment "Path" variable

              This is wrong. Use the correct visual studio command prompt from your start menu as we already told you...

              D Offline
              D Offline
              dan1973
              wrote on last edited by
              #9

              @Christian-Ehrlicher how to do this?

              1 Reply Last reply
              0
              • D Offline
                D Offline
                dan1973
                wrote on last edited by
                #10

                i am able to open Developer command prompt for VS 2022.
                But from here how to run config command?

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dan1973
                  wrote on last edited by
                  #11

                  C:\Program Files\Microsoft Visual Studio\2022\Professional>configure.bat -debug-and-release
                  Access is denied.
                  CMake Error at D:/Dev/Qt/src/cmake/QtWriteArgsFile.cmake:21 (file):
                  file failed to open for reading (No such file or directory):

                  C:/Program Files/Microsoft Visual Studio/2022/Professional/config.tl.opt.in
                  

                  CMake Error at D:/Dev/Qt/src/cmake/QtIRCommandLineHelpers.cmake:261 (file):
                  file STRINGS file "C:/Program Files/Microsoft Visual
                  Studio/2022/Professional/config.tl.opt" cannot be read.
                  Call Stack (most recent call first):
                  D:/Dev/Qt/src/cmake/QtIRCommandLineHelpers.cmake:295 (qt_ir_get_raw_args_from_optfile)
                  D:/Dev/Qt/src/cmake/QtIRHelpers.cmake:349 (qt_ir_process_args_from_optfile)
                  D:/Dev/Qt/src/cmake/QtTopLevelHelpers.cmake:51 (qt_ir_run_main_script)
                  D:/Dev/Qt/src/cmake/QtTopLevelConfigureScript.cmake:17 (qt_tl_run_main_script)

                  Could Not Find C:\Program Files\Microsoft Visual Studio\2022\Professional\config.tl.opt.in
                  Could Not Find C:\Program Files\Microsoft Visual Studio\2022\Professional\config.tl.opt

                  C:\Program Files\Microsoft Visual Studio\2022\Professional>

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

                    Now tell us why you want to build Qt in your visual studio installation directory...
                    Create a proper build dir.

                    Why do you want to compile Qt by yourself at all?

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

                    D 1 Reply Last reply
                    2
                    • Christian EhrlicherC Christian Ehrlicher

                      Now tell us why you want to build Qt in your visual studio installation directory...
                      Create a proper build dir.

                      Why do you want to compile Qt by yourself at all?

                      D Offline
                      D Offline
                      dan1973
                      wrote on last edited by
                      #13

                      @Christian-Ehrlicher i want to install qt 6.2.8 in my folder D:\dev\Qt\Qt6

                      jsulmJ 1 Reply Last reply
                      0
                      • D dan1973

                        @Christian-Ehrlicher i want to install qt 6.2.8 in my folder D:\dev\Qt\Qt6

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

                        @dan1973 said in Error while Building Qt 6.8.2 from Source:

                        i want to install qt 6.2.8 in my folder D:\dev\Qt\Qt6

                        This does not answer @Christian-Ehrlicher questions...

                        First: do not build inside visual studio installation directory.
                        Second: are you sure you have to build Qt by yourself instead of using Qt Online Installer to install Qt?

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

                        1 Reply Last reply
                        1
                        • Christian EhrlicherC Christian Ehrlicher referenced this topic on

                        • Login

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