Tag Archives: The C compiler identification is unknown No CMAKE_C_COMPILER could be found

The C compiler identification is unknown No CMAKE_C_COMPILER could be found

Current system environment.

1.Windows 7 Chinese flagship version

2.Visual studio 2017态Visual studio 2019

3.Cmake 3.8.1

 

Error Message:

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.

 

Solution.

1, ensure that when installing VS, the compiler for C++ is installed (you can test it by directly creating a new project with VS and checking whether the compilation passes).

2. Check the installation options for Windows 8.1 SDK and UCRT SDK (the default is unchecked)

3. Make sure that the correct compilation version is selected when coexisting with multiple versions of VS.

Links to related issues.

https://stackoverflow.com/questions/32801638/cmake-error-at-cmakelists-txt30-project-no-cmake-c-compiler-could-be-found