Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

The C compiler identification is unknown #588

Closed
hynguyen2610 opened this issue Jan 5, 2016 · 9 comments
Closed

The C compiler identification is unknown #588

hynguyen2610 opened this issue Jan 5, 2016 · 9 comments

Comments

@hynguyen2610
Copy link

I installed cmake.
When trying to run the build.bat, I got this error.

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

@jkotas
Copy link
Member

jkotas commented Jan 5, 2016

Do you have Visual Studio 2015 installed? Could you please try running the build in VS2015 x64 Native Tools Command Prompt?

@hynguyen2610
Copy link
Author

I have Visual Studio 2015 Community installed, with C# and C++ modules. Tried to run build.bat with VS2015 x64 Native Tools Command Prompt, but this error still happened.

@jkotas
Copy link
Member

jkotas commented Jan 5, 2016

@hynguyen2610
Copy link
Author

I findout this error because I install CMake before VS. Remove CMake and reinstall fix this

@cipher982
Copy link

I have spent hours trying to figure this out, but re-installing CMake AFTER VS finally got it all working.

@walter211
Copy link

tried, failed。@cipher982

@v2up
Copy link

v2up commented Apr 6, 2017

same as @walter211 sad

@Alan-FGR
Copy link

Alan-FGR commented Jun 13, 2017

@walter211, @mafanshu: Are your guys uninstalling CMake and reinstalling or just using the modify option?
In any case, I'm not sure if that will fix the problem, try pointing CMake manually to cl.exe and see if it drops a linker error. CMake compiles a simple program for testing and it may drop some errors, possibly a missing lib (which can be installed in the VS installer program... maybe ucrt).
See also:
https://stackoverflow.com/questions/42701019/problems-generating-solution-for-vs-2017-with-cmake

@PathogenDavid
Copy link

In my case this issue was being caused by not having the Spectre mitigated libraries installed. (Checking the CMake logs reveals the warning "warning MSB8038: Spectre mitigation is enabled but Spectre mitigated libraries are not found." followed by an error to link MSVCRTD.lib when CMake tries to validate the compiler.)

Spectre mitigations are supposed to be off by default, but they aren't in Visual Studio 2017.

The workaround is to install the "VC++ 2017 version 15.9 v14.16 Libs for Spectre (x86 and x64)" component or to use Visual Studio 2019 instead (which does not have this issue.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants