今天,我把笔记本电脑升级到和CLion。当我打开这个项目的时候,我看到了这个:
/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]‘伙计们,我该怎么解决呢?’
我不知道该怎么做。
我是C语言编程的初学者(
发布于 2022-10-30 20:19:01
我也遇到了同样的问题,并通过安装xcode-选择和在终端中使用以下命令重新安装cmake来解决这个问题:
xcode-select --installbrew reinstall cmakehttps://stackoverflow.com/questions/74227020
复制相似问题