我们在使用Visual Studio2012在Windows764位下使用CMake (v2.8.12)编译项目时遇到了问题。CMake给了我们以下错误。我们已经尝试使用管理员权限从Visual Studio命令行启动Cmake。在CMake 2.8.11中似乎有一个类似的bug: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".发布于 2014-03-11 16:27:20
我也有同样的问题,并以Admin的身份运行cmake来解决它
发布于 2016-07-12 03:17:58
这些错误消息
The C compiler identification is unknown
The CXX compiler identification is unknown意味着CMake确实找到或假定了一个编译器,但它不能编译一个简单的测试程序。
查看CMakeFiles\CMakeError.log并检查那里的错误消息,以查看:
例如LINK : fatal error LNK1181: cannot open input file 'kernel32.lib'
如果您将--debug-trycompile添加到cmake调用中,CMake甚至会保留它尝试测试编译的文件(这样您就可以从cmd外壳程序的错误日志中复制/粘贴/重新运行命令行)。
上一次我遇到这个问题时...
我上一次遇到这个问题是在我的Visual Studio 2012 Professional标准安装没有安装任何Windows SDK时(错误日志显示缺少SDK标题)。
要验证您的SDK安装,请检查是否安装了任何资源编译器。它的路径应该类似于:
C:\Program Files (x86)\Microsoft SDKs\Windows\v[some version]\bin\RC.Exe由于我错过了这个--或者更准确地说,任何SDK --我安装了Windows 8.1 SDK (因为Visual Studio2012的目标是Windows8.x),瞧,我的CMake能够再次编译(测试)程序。
参考
发布于 2020-12-04 12:00:49
我正在获取终端输出:
The C compiler identification is unknown
The CXX compiler identification is unknown我检查了CMakeError.log输出:
\build\CMakeFiles\CMakeError.log它显示了错误:
warning MSB8003: The WindowsSDKDir property is not defined. Some build tools may not be found.回到visual Studio,我需要安装Windows 10 SDK:

安装SDK并运行cmake后,显示:
Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.18363.
The C compiler identification is MSVC 19.28.29334.0
The CXX compiler identification is MSVC 19.28.29334.0并成功构建!
https://stackoverflow.com/questions/20632860
复制相似问题