gpt4 book ai didi

c++ - CMake:C 编译器标识未知

转载 作者:搜寻专家 更新时间:2023-10-31 01:44:40 25 4
gpt4 key购买 nike

我正在尝试通过 cmake 2.8.12 在 32 位架构中使用 visual studio 10 构建一个项目。但是我收到这些错误并且 cmake 无法创建项目。谁能给我建议一个解决方案。谢谢。

这是在 cmake-gui 窗口中显示的错误:

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 命令是否有效
  4. 使用cmake -G "Visual Studio 10"...生成

关于c++ - CMake:C 编译器标识未知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23235601/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com