代码之家  ›  专栏  ›  技术社区  ›  fferri

Windows上的QtCreator:找不到CMAKE_CXX_COMPILER

  •  0
  • fferri  · 技术社区  · 4 年前

    我有Visual Studio 2019、CMake 3.18.4、Ninja 1.10.1、Qt 5.15.0、QtCreator 4.13.2,我正试图用QtCreacher打开一个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.
    

    不管怎样 CMake工具 在套件配置中选择(我可以从中选择 CMake 3.18.3(Qt) C:\程序文件\cCMake\bin\CMake.exe中的系统CMake )

    套件配置显示警告标志,但不清楚问题所在:

    enter image description here

    显而易见的问题似乎是 "-DCMAKE_CXX_COMPILER:STRING=" 传递给CMake(空字符串)。

    但是C和C++编译器是在工具包中设置的。

    0 回复  |  直到 4 年前
        1
  •  1
  •   fferri    4 年前

    已解决 升级 通过Qt维护工具。