当前系统环境:
1、Windows 7中文旗舰版
2、Visual studio 2017、Visual studio 2019
3、Cmake 3.8.1
报错信息:
The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.
解决办法:
1、确保安装VS时,安装了C++的编译器(可用VS直接新建工程并查看编译是否通过来测试);
2、安装选项勾选Windows 8.1 SDK 和 UCRT SDK(默认是不勾选的)
3、确保VS多版本共存时,选择了正确的编译版本。
相关问题链接:
https://stackoverflow.com/questions/32801638/cmake-error-at-cmakelists-txt30-project-no-cmake-c-compiler-could-be-found
The C compiler identification is unknown No CMAKE_C_COMPILER could be found
原文:https://www.cnblogs.com/garly/p/10252924.html