首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Windows上的QtCreator :找不到CMAKE_CXX_COMPILER

Windows上的QtCreator :找不到CMAKE_CXX_COMPILER
EN

Stack Overflow用户
提问于 2020-12-02 16:25:43
回答 1查看 1.5K关注 0票数 1

我有VisualStudio2019,CMake 3.18.4,Ninja1.10.1,Qt5.15.0,QtCreator 4.13.2,我正在尝试用QtCreator打开一个Qt/CMake项目。

我从CMake获得了这个输出:

代码语言:javascript
运行
复制
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++编译器。

EN

Stack Overflow用户

发布于 2020-12-03 09:45:48

通过通过Qt维护工具升级解决了问题。

票数 1
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65112105

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档