0

I'm new to C++ and with some research I found out CLion is the IDE to use for writing C++ programs and compiling and running it. Things I did,

  1. Installed CLION on my Mac.
  2. Created a project for C++.
  3. It automatically created a main.cpp file and executed it.

Error which I'm getting is,

/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_DEPENDS_USE_COMPILER=FALSE -G "CodeBlocks - Unix Makefiles" /Users/madstuff/CLionProjects/basics
-- The C compiler identification is unknown
-- The CXX 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.20/Modules/CMakeTestCCompiler.cmake:66 (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/madstuff/CLionProjects/basics/cmake-build-debug/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/make -f Makefile cmTC_7dd5e/fast && xcrun: error: active developer path ("/Applications/Xcode-beta.app/Contents/Developer") does not exist
    Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
    See `man xcode-select` for more details.
    
  CMake will not be able to correctly generate this project.

I googled the error and on Jetbrains website someone suggested to try below thing,

  1. Open the Terminal, and run the following command: xcode-select --install

  2. After that in CLion did, Tools | CMake | Reset Cache and Reload Project.

I tried it, but still I'm getting the same error.

3
  • You have to install the xcode development tools, it tells you how at the end of the error message. Commented Oct 20, 2021 at 7:52
  • @ShadowMitia: I thought I installed it using, xcode-select --install.
    – Madstuffs
    Commented Oct 20, 2021 at 7:57
  • You probably also have to install XCode from the App Store. You used to only need one or the other (XCode or XCode CLT), but they're separate entities now, and CLion appears to depend more on the presence of XCode than the CLT. At least that's my guess as to what's going on.
    – sweenish
    Commented Oct 20, 2021 at 8:03

0

Browse other questions tagged or ask your own question.