Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake : C and CXX compiler identification is unknown Win10 CMakeGUI

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

like image 522
Aldo aldo Avatar asked Dec 02 '22 12:12

Aldo aldo


2 Answers

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.

like image 174
rubenvb Avatar answered Dec 04 '22 02:12

rubenvb


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 

enter image description here

like image 22
J.B.D Avatar answered Dec 04 '22 00:12

J.B.D