Window 11, Qt 6.8.0 - Errors in QtCreator when trying to build a project with Cmake
Unsolved
Qt Creator and other tools
-
Seek help! This was my first attempt to build a project with Cmake and I ran into the following issue:
Generating compilation database for Clang-Tidy at "C:\Users\26375\AppData\Local\Temp\QtCreator-TMyAyu\Clang-Tidy.yKTBDK" ... Compilation database for Clang-Tidy successfully generated at "C:\Users\26375\AppData\Local\Temp\QtCreator-TMyAyu\Clang-Tidy.yKTBDK". Generating compilation database for Clazy at "C:\Users\26375\AppData\Local\Temp\QtCreator-TMyAyu\Clazy.IrqcrL" ... Compilation database for Clazy successfully generated at "C:\Users\26375\AppData\Local\Temp\QtCreator-TMyAyu\Clazy.IrqcrL". [cmake] Running D:\Program\Qt\Tools\CMake_64\bin\cmake.exe -S D:/Program/C++code/Qt/untitled3 -B D:/Program/C++code/Qt/untitled3/build/Desktop_Qt_6_8_0_MSVC2022_64bit-Debug "-DCMAKE_PREFIX_PATH:PATH=D:/Program/Qt/6.8.0/msvc2022_64" "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DQT_QMAKE_EXECUTABLE:FILEPATH=D:/Program/Qt/6.8.0/msvc2022_64/bin/qmake.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=D:\Program\C++code\Qt\untitled3\build\Desktop_Qt_6_8_0_MSVC2022_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG" in D:\Program\C++code\Qt\untitled3\build\Desktop_Qt_6_8_0_MSVC2022_64bit-Debug. [cmake] CMake Error at CMakeLists.txt:3 (project): [cmake] project could not find requested file: [cmake] [cmake] D:/Program/C++code/Qt/untitled3/build/Desktop_Qt_6_8_0_MSVC2022_64bit-Debug/.qtc/package-manager/auto-setup.cmake [cmake] [cmake] [cmake] CMake Error at D:/Program/Qt/Tools/CMake_64/share/cmake-3.30/Modules/FindThreads.cmake:66 (message): [cmake] FindThreads only works if either C or CXX language is enabled [cmake] Call Stack (most recent call first): [cmake] D:/Program/Qt/Tools/CMake_64/share/cmake-3.30/Modules/CMakeFindDependencyMacro.cmake:76 (find_package) [cmake] D:/Program/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6/QtPublicDependencyHelpers.cmake:36 (find_dependency) [cmake] D:/Program/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6/Qt6Dependencies.cmake:34 (_qt_internal_find_third_party_dependencies) [cmake] D:/Program/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6/Qt6Config.cmake:136 (include) [cmake] CMakeLists.txt:12 (find_package) [cmake] [cmake] [cmake] -- Configuring incomplete, errors occurred! [cmake] [cmake] The command "D:\Program\Qt\Tools\CMake_64\bin\cmake.exe -S D:/Program/C++code/Qt/untitled3 -B D:/Program/C++code/Qt/untitled3/build/Desktop_Qt_6_8_0_MSVC2022_64bit-Debug "-DCMAKE_PREFIX_PATH:PATH=D:/Program/Qt/6.8.0/msvc2022_64" "-DCMAKE_COLOR_DIAGNOSTICS:BOOL=ON" "-DCMAKE_C_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_BUILD_TYPE:STRING=Debug" "-DQT_QMAKE_EXECUTABLE:FILEPATH=D:/Program/Qt/6.8.0/msvc2022_64/bin/qmake.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe" "-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=D:\Program\C++code\Qt\untitled3\build\Desktop_Qt_6_8_0_MSVC2022_64bit-Debug/.qtc/package-manager/auto-setup.cmake" "-DCMAKE_GENERATOR:STRING=Ninja" "-DCMAKE_CXX_FLAGS_INIT:STRING=-DQT_QML_DEBUG"" terminated with exit code 1. [cmake] [cmake] Elapsed time: 00:00.
This is the auto-generated CmakeList.txt
And here is my configure
I have already uninstalled and reinstalled Qt several times but it did not help.
How can I solve this?Thank you. -
The setup that you have should work. You can get rid of the cmake auto-setup (which should always work) by disabling the feature in Preferences > CMake > Package manager auto setup.
Then create a new project / remove the build directory of the existing project and reload the project.