Asher Asher - 2 months ago 44
C++ Question

CMake does not find Visual C++ compiler

After installing Visual Studio 2015 and running CMake on a previous project, cmake errors stating that it could not find the C compiler.

The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:4 (PROJECT):
No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:4 (PROJECT):
No CMAKE_CXX_COMPILER could be found.

I went searching for
in the Visual Studio folder,
C:\Program Files\Microsoft Visual Studio 14.0
, and could not find it.

How do I set up CMake to work on Windows with Visual Studio 2015?


I have found the solution. While Visual Studio IDE installed successfully it did not install any build tools and therefore did not install the C++ compiler. By attempting to manually create a C++ project in the Visual Studio 2015 GUI I was able to prompt it to download the C++ packages. Cmake was then able to find the compiler without any difficulty.