【问题标题】:Error with CLion (The C compiler identification is unknown) MacOS VenturaCLion 出错(C 编译器标识未知)MacOS Ventura
【发布时间】:2022-11-03 08:56:14
【问题描述】:

今天我用它把我的笔记本电脑更新到了 Mac OS Ventura 和 CLion。当我打开项目时,我看到了这个:

/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]

**Guys, how can I fix it ? **

我不知道该怎么做。

我是 C 编程的初学者(

【问题讨论】:

  • 我不熟悉 macOS 和 CLion,所以考虑到您发布的输出,这可能是一个愚蠢的问题,但是“打开项目”是什么意思?

标签: c compiler-errors runtime-error


【解决方案1】:

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

  • xcode-select --install
  • brew reinstall cmake

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-07-12
    • 2016-12-15
    • 1970-01-01
    • 2014-01-05
    • 2023-03-16
    • 1970-01-01
    • 2018-10-21
    • 2017-10-06
    相关资源
    最近更新 更多