I am not able to generate CMake Configuration, getting this error, Spent 48+ trying to resolve this.
-
[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 Christian Ehrlicher moved this topic from General and Desktop on
-
[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.@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. -
[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.@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:
- Go To Preferences > Kits > Compilers
- Click on Remove All
- Click on Re-detect
- Restart Qt Creator
-
@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.@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.
-
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.