iostream file not found after installing plugins
I am using MacOS and after I have installed some plugins, (Indent rainbow, bracket rainbow, atom material icon and material theme UI), the IDE come weird. When I open a new project, the compiler gets an error:
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/Library/Developer/CommandLineTools/usr/bin/g++ -G "CodeBlocks - Unix Makefiles" /Users/sunnytam/CLionProjects/Lab3
-- 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 /Applications/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/sunnytam/CLionProjects/Lab3/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_cb0fd/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)
CMake Error at CMakeLists.txt:2 (project):
The CMAKE_CXX_COMPILER:
/Library/Developer/CommandLineTools/usr/bin/g++
is not a full path to an existing compiler tool.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "/Users/sunnytam/CLionProjects/Lab3/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/Users/sunnytam/CLionProjects/Lab3/cmake-build-debug/CMakeFiles/CMakeError.log".
[Previous CMake output restored: 25/2/2021, 13:15]
And as I open my older project, the basic file are gone, like 'iostream' file not found error were given
Can anyone tell me what is going on?
请先登录再写评论。
Hello!
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.