Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. I am not able to generate CMake Configuration, getting this error, Spent 48+ trying to resolve this.

I am not able to generate CMake Configuration, getting this error, Spent 48+ trying to resolve this.

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
5 Posts 3 Posters 879 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
    Divakar
    wrote on 6 Oct 2024, 20:44 last edited by
    #1

    [cmake] Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Users/User/Documents/Total_Media_Player -B C:/Users/User/Documents/Total_Media_Player/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.7.3/msvc2019_64/bin/qmake.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.7.3/msvc2019_64" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" in C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug.
    [cmake] -- The CXX compiler identification is MSVC 19.41.34120.0
    [cmake] -- Detecting CXX compiler ABI info
    [cmake] -- Detecting CXX compiler ABI info - failed
    [cmake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe
    [cmake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe - broken
    [cmake] CMake Error at C:/Qt/Tools/CMake_64/share/cmake-3.29/Modules/CMakeTestCXXCompiler.cmake:73 (message):
    [cmake] The C++ compiler
    [cmake]
    [cmake] "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe"
    [cmake]
    [cmake] is not able to compile a simple test program.
    [cmake]
    [cmake] It fails with the following output:
    [cmake]
    [cmake] Change Dir: 'C:/Users/User/Documents/Total_Media_Player/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/CMakeFiles/CMakeScratch/TryCompile-nkw3ms'
    [cmake]
    [cmake] Run Build Command(s): C:/PROGRA~1/MICROS~2/2022/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe -v cmTC_14b70
    [cmake] [1/2] C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\HostX64\x64\cl.exe /nologo /TP -DQT_QML_DEBUG /DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0 /Od /RTC1 -MDd /showIncludes /FoCMakeFiles\cmTC_14b70.dir\testCXXCompiler.cxx.obj /FdCMakeFiles\cmTC_14b70.dir\ /FS -c C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug\CMakeFiles\CMakeScratch\TryCompile-nkw3ms\testCXXCompiler.cxx
    [cmake] [2/2] C:\Windows\system32\cmd.exe /C "cd . && C:\Qt\Tools\CMake_64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_14b70.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_14b70.dir\testCXXCompiler.cxx.obj /out:cmTC_14b70.exe /implib:cmTC_14b70.lib /pdb:cmTC_14b70.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
    [cmake] FAILED: cmTC_14b70.exe
    [cmake] C:\Windows\system32\cmd.exe /C "cd . && C:\Qt\Tools\CMake_64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_14b70.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_14b70.dir\testCXXCompiler.cxx.obj /out:cmTC_14b70.exe /implib:cmTC_14b70.lib /pdb:cmTC_14b70.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
    [cmake] LINK Pass 1: command "C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_14b70.dir\testCXXCompiler.cxx.obj /out:cmTC_14b70.exe /implib:cmTC_14b70.lib /pdb:cmTC_14b70.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_14b70.dir/intermediate.manifest CMakeFiles\cmTC_14b70.dir/manifest.res" failed (exit code 1104) with the following output:
    [cmake] LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
    [cmake]
    [cmake] ninja: build stopped: subcommand failed.
    [cmake]
    [cmake]
    [cmake]
    [cmake]
    [cmake]
    [cmake] CMake will not be able to correctly generate this project.
    [cmake] Call Stack (most recent call first):
    [cmake] CMakeLists.txt:4 (project)
    [cmake]
    [cmake]
    [cmake] -- Configuring incomplete, errors occurred!
    [cmake]
    [cmake] The command "C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Users/User/Documents/Total_Media_Player -B C:/Users/User/Documents/Total_Media_Player/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.7.3/msvc2019_64/bin/qmake.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.7.3/msvc2019_64" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe"" terminated with exit code 1.
    [cmake]
    [cmake] Elapsed time: 00:02.

    C C 2 Replies Last reply 6 Oct 2024, 21:02
    0
    • C Christian Ehrlicher moved this topic from General and Desktop on 6 Oct 2024, 21:01
    • D Divakar
      6 Oct 2024, 20:44

      [cmake] Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Users/User/Documents/Total_Media_Player -B C:/Users/User/Documents/Total_Media_Player/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.7.3/msvc2019_64/bin/qmake.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.7.3/msvc2019_64" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" in C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug.
      [cmake] -- The CXX compiler identification is MSVC 19.41.34120.0
      [cmake] -- Detecting CXX compiler ABI info
      [cmake] -- Detecting CXX compiler ABI info - failed
      [cmake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe
      [cmake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe - broken
      [cmake] CMake Error at C:/Qt/Tools/CMake_64/share/cmake-3.29/Modules/CMakeTestCXXCompiler.cmake:73 (message):
      [cmake] The C++ compiler
      [cmake]
      [cmake] "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe"
      [cmake]
      [cmake] is not able to compile a simple test program.
      [cmake]
      [cmake] It fails with the following output:
      [cmake]
      [cmake] Change Dir: 'C:/Users/User/Documents/Total_Media_Player/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/CMakeFiles/CMakeScratch/TryCompile-nkw3ms'
      [cmake]
      [cmake] Run Build Command(s): C:/PROGRA~1/MICROS~2/2022/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe -v cmTC_14b70
      [cmake] [1/2] C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\HostX64\x64\cl.exe /nologo /TP -DQT_QML_DEBUG /DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0 /Od /RTC1 -MDd /showIncludes /FoCMakeFiles\cmTC_14b70.dir\testCXXCompiler.cxx.obj /FdCMakeFiles\cmTC_14b70.dir\ /FS -c C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug\CMakeFiles\CMakeScratch\TryCompile-nkw3ms\testCXXCompiler.cxx
      [cmake] [2/2] C:\Windows\system32\cmd.exe /C "cd . && C:\Qt\Tools\CMake_64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_14b70.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_14b70.dir\testCXXCompiler.cxx.obj /out:cmTC_14b70.exe /implib:cmTC_14b70.lib /pdb:cmTC_14b70.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
      [cmake] FAILED: cmTC_14b70.exe
      [cmake] C:\Windows\system32\cmd.exe /C "cd . && C:\Qt\Tools\CMake_64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_14b70.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_14b70.dir\testCXXCompiler.cxx.obj /out:cmTC_14b70.exe /implib:cmTC_14b70.lib /pdb:cmTC_14b70.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
      [cmake] LINK Pass 1: command "C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_14b70.dir\testCXXCompiler.cxx.obj /out:cmTC_14b70.exe /implib:cmTC_14b70.lib /pdb:cmTC_14b70.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_14b70.dir/intermediate.manifest CMakeFiles\cmTC_14b70.dir/manifest.res" failed (exit code 1104) with the following output:
      [cmake] LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
      [cmake]
      [cmake] ninja: build stopped: subcommand failed.
      [cmake]
      [cmake]
      [cmake]
      [cmake]
      [cmake]
      [cmake] CMake will not be able to correctly generate this project.
      [cmake] Call Stack (most recent call first):
      [cmake] CMakeLists.txt:4 (project)
      [cmake]
      [cmake]
      [cmake] -- Configuring incomplete, errors occurred!
      [cmake]
      [cmake] The command "C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Users/User/Documents/Total_Media_Player -B C:/Users/User/Documents/Total_Media_Player/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.7.3/msvc2019_64/bin/qmake.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.7.3/msvc2019_64" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe"" terminated with exit code 1.
      [cmake]
      [cmake] Elapsed time: 00:02.

      C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 6 Oct 2024, 21:02 last edited by
      #2

      @Divakar said in I am not able to generate CMake Configuration, getting this error, Spent 48+ trying to resolve this.:

      C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.7.3/msvc2019_64/bin/qmake.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.7.3/msvc2019_64" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" in C:

      As you can see you somehow mix MSVC2019 and MSVC2022.
      Make sure your kit settings are correct and use MSVC2022 in a clean build dir.

      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 8 Oct 2024, 01:14
      1
      • D Divakar
        6 Oct 2024, 20:44

        [cmake] Running C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Users/User/Documents/Total_Media_Player -B C:/Users/User/Documents/Total_Media_Player/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.7.3/msvc2019_64/bin/qmake.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.7.3/msvc2019_64" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" in C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug.
        [cmake] -- The CXX compiler identification is MSVC 19.41.34120.0
        [cmake] -- Detecting CXX compiler ABI info
        [cmake] -- Detecting CXX compiler ABI info - failed
        [cmake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe
        [cmake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe - broken
        [cmake] CMake Error at C:/Qt/Tools/CMake_64/share/cmake-3.29/Modules/CMakeTestCXXCompiler.cmake:73 (message):
        [cmake] The C++ compiler
        [cmake]
        [cmake] "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe"
        [cmake]
        [cmake] is not able to compile a simple test program.
        [cmake]
        [cmake] It fails with the following output:
        [cmake]
        [cmake] Change Dir: 'C:/Users/User/Documents/Total_Media_Player/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/CMakeFiles/CMakeScratch/TryCompile-nkw3ms'
        [cmake]
        [cmake] Run Build Command(s): C:/PROGRA~1/MICROS~2/2022/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe -v cmTC_14b70
        [cmake] [1/2] C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\HostX64\x64\cl.exe /nologo /TP -DQT_QML_DEBUG /DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0 /Od /RTC1 -MDd /showIncludes /FoCMakeFiles\cmTC_14b70.dir\testCXXCompiler.cxx.obj /FdCMakeFiles\cmTC_14b70.dir\ /FS -c C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug\CMakeFiles\CMakeScratch\TryCompile-nkw3ms\testCXXCompiler.cxx
        [cmake] [2/2] C:\Windows\system32\cmd.exe /C "cd . && C:\Qt\Tools\CMake_64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_14b70.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_14b70.dir\testCXXCompiler.cxx.obj /out:cmTC_14b70.exe /implib:cmTC_14b70.lib /pdb:cmTC_14b70.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
        [cmake] FAILED: cmTC_14b70.exe
        [cmake] C:\Windows\system32\cmd.exe /C "cd . && C:\Qt\Tools\CMake_64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_14b70.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_14b70.dir\testCXXCompiler.cxx.obj /out:cmTC_14b70.exe /implib:cmTC_14b70.lib /pdb:cmTC_14b70.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
        [cmake] LINK Pass 1: command "C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_14b70.dir\testCXXCompiler.cxx.obj /out:cmTC_14b70.exe /implib:cmTC_14b70.lib /pdb:cmTC_14b70.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_14b70.dir/intermediate.manifest CMakeFiles\cmTC_14b70.dir/manifest.res" failed (exit code 1104) with the following output:
        [cmake] LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
        [cmake]
        [cmake] ninja: build stopped: subcommand failed.
        [cmake]
        [cmake]
        [cmake]
        [cmake]
        [cmake]
        [cmake] CMake will not be able to correctly generate this project.
        [cmake] Call Stack (most recent call first):
        [cmake] CMakeLists.txt:4 (project)
        [cmake]
        [cmake]
        [cmake] -- Configuring incomplete, errors occurred!
        [cmake]
        [cmake] The command "C:\Qt\Tools\CMake_64\bin\cmake.exe -S C:/Users/User/Documents/Total_Media_Player -B C:/Users/User/Documents/Total_Media_Player/build/Desktop_Qt_6_7_3_MSVC2019_64bit-Debug "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.7.3/msvc2019_64/bin/qmake.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.7.3/msvc2019_64" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe"" terminated with exit code 1.
        [cmake]
        [cmake] Elapsed time: 00:02.

        C Online
        C Online
        cristian-adam
        wrote on 7 Oct 2024, 09:16 last edited by
        #3

        @Divakar It might be that you updated Visual Studio and Qt Creator uses old paths to your Visual C++ compiler.

        I usually do the following:

        1. Go To Preferences > Kits > Compilers
        2. Click on Remove All
        3. Click on Re-detect
        4. Restart Qt Creator
        1 Reply Last reply
        1
        • C Christian Ehrlicher
          6 Oct 2024, 21:02

          @Divakar said in I am not able to generate CMake Configuration, getting this error, Spent 48+ trying to resolve this.:

          C:\Users\User\Documents\Total_Media_Player\build\Desktop_Qt_6_7_3_MSVC2019_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" "-DQT_QMAKE_EXECUTABLE:FILEPATH=C:/Qt/6.7.3/msvc2019_64/bin/qmake.exe" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" "-DCMAKE_PREFIX_PATH:PATH=C:/Qt/6.7.3/msvc2019_64" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe" in C:

          As you can see you somehow mix MSVC2019 and MSVC2022.
          Make sure your kit settings are correct and use MSVC2022 in a clean build dir.

          D Offline
          D Offline
          Divakar
          wrote on 8 Oct 2024, 01:14 last edited by
          #4

          @Christian-Ehrlicher Thanks for replying, really apprciate the efforts understanding the problem statement.
          Here is what's a happened:

          While installing the visual studio using the installer I checked MSVC2019 as well along with the other toolchain but still it is somehow picking up the 2022 version.

          Also the compilers are getting picked up automatically in the kit.

          One weird thing I saw was that in C/Program/ directory I am only able to see 2022, not anything related to the 2019.

          1 Reply Last reply
          0
          • C Online
            C Online
            cristian-adam
            wrote on 8 Oct 2024, 05:52 last edited by
            #5

            You can access the 2019 compilers, but you have to manually configure them. See https://forum.qt.io/topic/158930/qt-creator-cannot-set-up-msvc2019-compiler-successfully for details.

            Alternatively you can install Visual Studio 2019, then Qt Creator will pick the 2019 compilers automatically.

            1 Reply Last reply
            1

            5/5

            8 Oct 2024, 05:52

            • Login

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