更新到xcode 8后,Clion和CMake失败

时间:2016-09-19 15:41:54

标签: xcode cmake clion

更新到xcode 8后出现以下错误,我不确定如何修复。

Error:The C compiler "/usr/bin/cc" is not able to compile a simple test program.
It fails with the following output:
 Change Dir: /Users/username/Library/Caches/CLion2016.2/cmake/generated/CacheBack-27c25a9c/27c25a9c/__default__/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_e91e5/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_e91e5.dir/build.make CMakeFiles/cmTC_e91e5.dir/build
Building C object CMakeFiles/cmTC_e91e5.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTC_e91e5.dir/testCCompiler.c.o -c /Users/username/Library/Caches/CLion2016.2/cmake/generated/CacheBack-27c25a9c/27c25a9c/__default__/CMakeFiles/CMakeTmp/testCCompiler.c
cc: error: unable to find utility "clang", not a developer tool or in PATH
make[1]: *** [CMakeFiles/cmTC_e91e5.dir/testCCompiler.c.o] Error 72
make: *** [cmTC_e91e5/fast] Error 2
CMake will not be able to correctly generate this project.

2 个答案:

答案 0 :(得分:1)

请检查 xcode-select -p,确保它指向Xcode 8安装并在此之后运行xcode-select --install

答案 1 :(得分:0)

启动Xcode后我必须接受许可证对话框以获取更新的组件。之后我重新启动了Clion并且它工作了。