首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CLion错误(C编译器标识未知) MacOS Ventura

CLion错误(C编译器标识未知) MacOS Ventura
EN

Stack Overflow用户
提问于 2022-10-27 18:58:30
回答 1查看 460关注 0票数 0

今天,我把笔记本电脑升级到和CLion。当我打开这个项目的时候,我看到了这个:

代码语言:javascript
复制
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/Applications/CLion.app/Contents/bin/ninja/mac/ninja -G Ninja -S /Users/nikita/Documents/CLion/untitled -B /Users/nikita/Documents/CLion/untitled/cmake-build-debug
-- The C compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - broken
CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.23/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/usr/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/nikita/Documents/CLion/untitled/cmake-build-debug/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/Applications/CLion.app/Contents/bin/ninja/mac/ninja cmTC_6cb20 && [1/2] Building C object CMakeFiles/cmTC_6cb20.dir/testCCompiler.c.o
    FAILED: CMakeFiles/cmTC_6cb20.dir/testCCompiler.c.o 
    /usr/bin/cc   -arch arm64 -o CMakeFiles/cmTC_6cb20.dir/testCCompiler.c.o -c /Users/nikita/Documents/CLion/untitled/cmake-build-debug/CMakeFiles/CMakeTmp/testCCompiler.c
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    ninja: build stopped: subcommand failed.
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "/Users/nikita/Documents/CLion/untitled/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/Users/nikita/Documents/CLion/untitled/cmake-build-debug/CMakeFiles/CMakeError.log".

[Finished]

伙计们,我该怎么解决呢?

我不知道该怎么做。

我是C语言编程的初学者(

EN

回答 1

Stack Overflow用户

发布于 2022-10-30 20:19:01

我也遇到了同样的问题,并通过安装xcode-选择和在终端中使用以下命令重新安装cmake来解决这个问题:

  • xcode-select --install
  • brew reinstall cmake
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74227020

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档