Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake :Error in configuration process, project files may be invalid Visual Studio 2017

I am currently trying to compile a project in CMake 3.10.0 and it keeps giving the above error box and this

    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.



    CMake Error at CMakeLists.txt:2 (project):
        No CMAKE_CXX_COMPILER could be found.



    Configuring incomplete, errors occurred!
    See also "C:/build/CMakeFiles/CMakeOutput.log".
    See also "C:/build/CMakeFiles/CMakeError.log".

I am currently running Microsoft Visual Studio 15 2017 and when I am configuring it, I am using x64.

like image 594
shaddles Avatar asked Dec 10 '22 09:12

shaddles


2 Answers

i had same problem when using vs 2015 but after installing vs 2017 it solved. I think you should repair your visual studio 2017 and try again. if cmake don`t let you configure with new vs in file tab clear use "delete cache" and try again

like image 152
N.S Avatar answered Dec 26 '22 08:12

N.S


When you installed Visual Studio 2017, did you install the Visual C++ compilers? It's not enabled by default. Go to Add or Remove programs and try Repairing/Modifying it to make sure Visual C++ is included.


This is going to sound like a stupid suggestion but if you've just installed VS 2017, make sure you're actually able to compile a sample C++ solution. Yes, you would be surprised by the amount of people I've seen with this error that simply didn't realize their compiler wasn't installed.


My third suggestion would be to try opening the x86 or x64 Native Tools Command Prompt and try running your CMake build again. The problem, as I'm sure you've noticed haha, is that it can't find your C compilers. Running these Command Prompts will ensure your correct environment variables are set. If this fails, your C compilers are missing and you need to re-install VS2017. If this works that means there's an issue with your environment PATH.

like image 36
Chris Avatar answered Dec 26 '22 08:12

Chris