Can't compile simple test program on Mac
Hello! Until some moment in the past I had succesfully used CLion, when I got the following message in the Debug:
"/Users/a1/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/203.7148.70/CLion.app/Contents/bin/cmake/mac/bin/cmake" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/a1/Cluster_analys
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - broken
CMake Error at /Users/a1/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/203.7148.70/CLion.app/Contents/bin/cmake/mac/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (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/a1/Cluster_analys/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_d665a/fast && xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
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/a1/Cluster_analys/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/Users/a1/Cluster_analys/cmake-build-debug/CMakeFiles/CMakeError.log".
[Failed to reload]
Trying to run new initial program didn't help too much. I looked for the solution to this problem but didn't find the answer. Thanks for any help!
请先登录再写评论。
Please open the Terminal, and run the following command: xcode-select --install
After that in CLion please do `Tools | CMake | Reset Cache and Reload Project`. It should help.
Was incredibly frustrated until I found your solution, thank you so much you just made my day!!!