CMake : C and CXX compiler identification is unknown Win10 CMakeGUI

谁都会走 提交于 2019-12-12 14:45:32

问题


So I am trying to configure a file based on this tutorial on youtube which is very simple :

https://www.youtube.com/watch?v=gYmgbqGfv-8

I use CMake GUI in Windows 10 and I have a running Visual Studio 2015 which is able to build c++ projects already (I've used it for some time)

I use "Visual Studio 15 2017"

I created a folder named hellocmake and hellocmake/build for both inputs:

my inputs

However when I tried to configure, it says that

CMake Error at CMakeLists.txt:1 (PROJECT):

No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:1 (PROJECT):

No CMAKE_CXX_COMPILER could be found.

The error log specifies that it can't find the two compiler files : Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler:
Build flags: Id flags:

The output was:
The system cannot find the file specified


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:  
Build flags: 
Id flags: 

The output was:
The system cannot find the file specified

I tried downloading the "CMakeCXXCompilerId.cpp" and "CMakeCXXCompilerId.c" files and try to add them manually in the same folder, but it doesnt solve it

I tried to look up several other sources which have a similar case but I can't seem to understand them. This problem didn't exist with my old computer so I assume it has something to do with the Visual Studio ?

Thank you guys, any help will be appreciated


回答1:


You selected Visual Studio 2017 which you don't have installed. I think you confused the actual version number (which is 15 for VS2017) for the year in which the version was released. Pick a VS2015 generator (version number 14) and it should work.




回答2:


I agree with @rubenvb's answer, add a tip: before you execute change "15" to "14", you should remove the "CMakeCache.txt" file.

cmake -G 



来源:https://stackoverflow.com/questions/40975780/cmake-c-and-cxx-compiler-identification-is-unknown-win10-cmakegui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!