10

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.

Brady Dean
  • 3,378
  • 5
  • 24
  • 50
  • Are you actually on a 64-bit OS – M.M May 31 '15 at 02:46
  • Try running that `cl.exe` from command prompt (not from within cmake) and see if it gives you any other error messges – M.M May 31 '15 at 02:47
  • Yes I am on 64bit Win7. cl.exe works fine otherwise. Forgot to mention I have just the Win7 SDK installed, no Visual Studio. – Brady Dean May 31 '15 at 02:48
  • Possible duplicate of [Cmake is Unable to Configure Project for Visual Studios 10 amd64](http://stackoverflow.com/questions/14319247/cmake-is-unable-to-configure-project-for-visual-studios-10-amd64) – Simone Pessotto Oct 19 '15 at 12:48

5 Answers5

3

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.

Community
  • 1
  • 1
Simone Pessotto
  • 1,561
  • 1
  • 15
  • 19
1

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
MineLPPhynix
  • 121
  • 2
  • 5
0

Try to use a new cvtres.exe to replace Microsoft Visual Studio 10.0\VC\bin\cvtres.exe,I used the one from vs2012, it works! Donot forget to backup.

0

In case Qt Creator 4.7.0 with CMake: I solved this problem by changing generator from 'NMake Makefiles JOM' to 'NMake Makefiles' in Tools->Options->Kits->Kits->CMake generator.

Fedorov7890
  • 1,173
  • 13
  • 28
0

If you are using qt with MSVC, don't forget to install cdb.

Qiuren
  • 19
  • 3
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 15 '21 at 07:33
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30343209) – Bracken Nov 16 '21 at 16:28