【发布时间】:2021-12-08 08:01:52
【问题描述】:
我在 Windows 上,我尝试使用 CMake-gui 编译 C/C++ 程序。
我的 PC 上安装了 Visual Studio 2019。
我将以下路径设置为 CXX 的 Windows 环境变量:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64
但是当我在 CMake-gui 中单击“配置”时,出现以下错误:
The C compiler identification is unknown
CMake Error at C:/Users/user1/mylibs/cmake-3.22.0-rc1-windows-x86_64/share/cmake-3.22/Modules/CMakeDetermineCXXCompiler.cmake:48 (message):
Could not find compiler set in environment variable CXX:
C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64.
Call Stack (most recent call first):
CMakeLists.txt:56 (PROJECT)
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
Configuring incomplete, errors occurred!
See also "C:/Users/user1/mylibs/assimp-master_build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/user1/mylibs/assimp-master_build/CMakeFiles/CMakeError.log".
知道如何解决这个问题吗?
谢谢
【问题讨论】:
标签: c++ c visual-studio cmake cmake-modules