CXX compiler id unknown

We had problems compiling the project using CMake (v2.8.12) under Windows 7 64Bit using Visual Studio 2012. CMake gives us the following errors. We have already tried to start Cmake from the Visual Studio command line using administrator rights. It seems that there was a similar error in CMake 2.8.11: http://www.cmake.org/Bug/view.php?id=14440

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446 (execute_process): execute_process given COMMAND argument with no value. Call Stack (most recent call first): C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48 (CMAKE_DETERMINE_COMPILER_ID_VENDOR) C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID) CMakeLists.txt:2 (project) The C compiler identification is unknown CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:446 (execute_process): execute_process given COMMAND argument with no value. Call Stack (most recent call first): C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:48 (CMAKE_DETERMINE_COMPILER_ID_VENDOR) C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:127 (CMAKE_DETERMINE_COMPILER_ID) CMakeLists.txt:2 (project) The CXX compiler identification is unknown Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR) CMake Warning at src/CMakeLists.txt:44 (message): SWIG was not found. You will not be able to compile for C#. Configuring incomplete, errors occurred! See also "C:/Users/hci/laser_control/CMakeFiles/CMakeOutput.log". See also "C:/Users/hci/laser_control/CMakeFiles/CMakeError.log". 
+16
c ++ visual-studio-2012 cmake
Dec 17 '13 at 11:26
source share
9 answers

I had the same problem and fixed it with cmake as admin

+10
Mar 11 '14 at 8:27
source share

I also had a similar problem if you are using Microsoft Visual Studio 2012, possibly due to update KB2781514 .

After I installed the next update, CMake will begin to correctly identify Visual Studio 2012 c / C ++ compilers.

http://www.microsoft.com/en-us/download/details.aspx?id=36020

+2
Dec 09 '14 at 12:46
source share

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:

  • which path / command line of the CMake compiler used
  • that the error message calling the compiler was

    eg. LINK : fatal error LNK1181: cannot open input file 'kernel32.lib'

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
+2
Jul 11 '16 at 19:17
source share

Same issue here with cmake 2.8.12 and visual studio 10. Cmake may not be able to find the compiler. I solved the problem by uninstalling the latest version and installing cmake 2.8.10.

0
Apr 22 '14 at 6:41
source share

I just run into this problem after I uninstall some MS software. I fixed it using visual studio 2012 rendering. First go to [Control Panel], then select a visual studio and edit it, everything will go right now.

0
Jun 30 '15 at 7:45
source share

Make sure you select the correct version of Visual Studio. For example, Visual Studio 2012 is version 11.

0
Jun 30 '15 at 14:25
source share

I had the same problem and had to use "File -> Delete Cache" since I accidentally configured CMake to use the wrong version of Visual Studio.

0
Feb 08 '16 at 13:34
source share

If you are using CMake 3.4.0, try upgrading to a newer version. A bug regarding this has been fixed relatively recently (see bug report).

0
Apr 29 '16 at 18:06
source share

I ran into the same problem. Creating and starting a project from Visual Studio did not work for me. However, the following worked for me:

  • Open a command prompt for developers from Visual Studio tools.
  • Go to the directory in which cmake.exe is present.
  • Run it.

Let's hope this works for you too.

0
Nov 09 '16 at 8:23
source share



All Articles