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,
- Installed CLION on my Mac.
- Created a project for C++.
- 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,
Open the Terminal, and run the following command: xcode-select --install
After that in CLion did,
Tools | CMake | Reset Cache and Reload Project
.
I tried it, but still I'm getting the same error.