CMake:C编译器标识未知 [英] CMake: The C compiler identification is unknown

查看:640
本文介绍了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) 


推荐答案


  1. 删除Cmake缓存

  2. 启动 Visual Studio 10(Win32)命令提示符

  3. 验证 cl cmake -GVisual Studio 10...

  1. Remove Cmake cache
  2. Start Visual Studio 10 (Win32) Command Prompt
  3. Verify that cl command works
  4. Generate with cmake -G "Visual Studio 10" ...

这篇关于CMake:C编译器标识未知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆