我有VisualStudio2019,CMake 3.18.4,Ninja1.10.1,Qt5.15.0,QtCreator 4.13.2,我正在尝试用QtCreator打开一个Qt/CMake项目。
我从CMake获得了这个输出:
2020-12-02T17:04:23 Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.
Running C:\Dev\Libs\Qt-5.15\Tools\CMake_64\bin\cmake.exe -S C:/Dev/test1 -B C:/Users/me/AppData/Local/Temp/QtCreator-GpQBVK/qtc-cmake-tnApaSrE -GNinja "-DCMAKE_BUILD_TYPE:String=Debug" "-DQT_QMAKE_EXECUTABLE:STRING=C:/Dev/Libs/Qt-5.15/5.15.0/msvc2019_64/bin/qmake.exe" "-DCMAKE_PREFIX_PATH:STRING=C:/Dev/Libs/Qt-5.15/5.15.0/msvc2019_64" "-DCMAKE_C_COMPILER:STRING=" "-DCMAKE_CXX_COMPILER:STRING=" in C:\Users\me\AppData\Local\Temp\QtCreator-GpQBVK\qtc-cmake-tnApaSrE.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_C_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/Users/me/AppData/Local/Temp/QtCreator-GpQBVK/qtc-cmake-tnApaSrE/CMakeFiles/CMakeOutput.log".
See also "C:/Users/me/AppData/Local/Temp/QtCreator-GpQBVK/qtc-cmake-tnApaSrE/CMakeFiles/CMakeError.log".
CMake process exited with exit code 1.
Elapsed time: 00:01.
无论在Kit配置中选择了哪种CMake工具(我可以从CMake 3.18.3 (Qt)和System CMake中选择C:\ProgramFiles\CMake\bin\cmake.exe)
该工具包配置显示了一个警告标志,但不清楚问题是什么:
明显的问题似乎是参数"-DCMAKE_CXX_COMPILER:STRING="
被传递给CMake (空字符串)。
但是工具包中设置了C和C++编译器。
发布于 2020-12-03 09:45:48
通过通过Qt维护工具升级解决了问题。
https://stackoverflow.com/questions/65112105
复制相似问题