CMake:C编译器标识未知 [英] CMake: The C compiler identification is unknown
本文介绍了CMake:C编译器标识未知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图通过cmake 2.8.12与32位架构中的visual studio 10构建一个项目。但我得到这些错误,cmake无法创建项目。任何人都可以建议我一个解决方案。感谢。
I am trying to build a project by cmake 2.8.12 with visual studio 10 in 32bit architecture. But I am getting these error and cmake is unable to create the project. Can anyone please suggest me a solution. Thanks.
这是在cmake-gui窗口中显示的错误:
This is the error showing in cmake-gui window:
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:3 (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:3 (project)
The CXX compiler identification is unknown
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
推荐答案
- 删除Cmake缓存
- 启动
Visual Studio 10(Win32)命令提示符
- 验证
cl
cmake -GVisual Studio 10...
- Remove Cmake cache
- Start
Visual Studio 10 (Win32) Command Prompt
- Verify that
cl
command works - Generate with
cmake -G "Visual Studio 10" ...
这篇关于CMake:C编译器标识未知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文