khrushchew
khrushchew

Reputation: 1

Error with CLion (The C compiler identification is unknown) MacOS Ventura

Today I updated my laptop to Mac OS Ventura and CLion with it. When I opened the project I saw this :

/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 ? **

I don't know how to do this.

I am a beginner in programming with C (

Upvotes: 0

Views: 1930

Answers (1)

Danya
Danya

Reputation: 21

I faced the same issue and it was solved by installing xcode-select and reinstalling cmake with the following commands in the terminal:

  • xcode-select --install
  • brew reinstall cmake

Upvotes: 2

Related Questions