Those error messages
The C compiler identification is unknown The CXX compiler identification is unknown
means that CMake found or suggested the compiler, but could not compile a simple test program.
Take a look at CMakeFiles\CMakeError.log and check the error message there:
If you add --debug-trycompile to the cmake call, CMake will even save the files that it tried to verify compilation (so that you can copy / paste / re-run the command line from the error log in the cmd shell).
Last time I had this problem ...
The last time I encountered this problem, my standard installation of Visual Studio 2012 Professional did not install the Windows SDK (the missing SDK header was shown in the error log).
To verify the installation of the SDK, for example. make sure you have some kind of resource compiler. It should be on a path like:
C:\Program Files (x86)\Microsoft SDKs\Windows\v[some version]\bin\RC.Exe
Since I was missing this - or rather, any SDK - I installed the Windows 8.1 SDK (since Visual Studio 2012 targets Windows 8.x) and voila my CMake was able to compile (test) programs again.
Link
- Does Visual Studio 2012 include the full Windows SDK ?
- CMake error in CMakeLists.txt: 30 (project): No CMAKE_C_COMPILER can be found
Florian Jul 11 '16 at 19:17 2016-07-11 19:17
source share