Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake cl.exe is not able to compile a simple test program

This is the CMake output:

-- The C compiler identification is MSVC 16.0.30319.1
-- The CXX compiler identification is MSVC 16.0.30319.1
-- Eclipse version is set to 3.6 (Helios). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio
10.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio
10.0/VC/bin/amd64/cl.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/amd64/cl.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: E:/Code/Git/Brendan-C-SFML/build/CMakeFiles/CMakeTmp

I've checked some other questions about this and they say to downgrade to .NET 4.0 but that didn't work for me.

like image 975
Brady Dean Avatar asked May 31 '15 02:05

Brady Dean


2 Answers

In this answer: Cmake is Unable to Configure Project for Visual Studios 10 amd64

I found the solution of my problem.

For me was:

I found that my x64 compilers were destroyed by installing SP 1. Try this update to restore them: http://www.microsoft.com/en-us/download/details.aspx?id=4422

I have updated the compilers and now it works.

like image 67
Simone Pessotto Avatar answered Oct 30 '22 11:10

Simone Pessotto


I got a similar problem with Visual Studio 2019 (on Windows 10).

I searched for it and this was the only stackoverflow question that (in the title) was similar to the output that i got from Visual Studio. I wasn't sure if I should create a question to answer it myself, so people who get the same problem probably find this solution. That's why I'm writing it under here.

Anyways, saving the CMake "project" (created by Visual Studio) and restarting the program solved the problem.

like image 32
MineLPPhynix Avatar answered Oct 30 '22 11:10

MineLPPhynix