mac中clion无法运行

错误描述:

/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/llwh/CLionProjects/suanfa6
CMake Warning at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.21/Modules/Platform/Darwin-Initialize.cmake:303 (message):
  Ignoring CMAKE_OSX_SYSROOT value:

   /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk

  because the directory does not exist.
Call Stack (most recent call first):
  /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.21/Modules/CMakeSystemSpecificInitialize.cmake:21 (include)
  CMakeLists.txt:2 (project)


-- The C compiler identification is AppleClang 13.0.0.13000029
-- The CXX compiler identification is AppleClang 13.0.0.13000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - broken
CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.21/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/Library/Developer/CommandLineTools/usr/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/llww/CLionProjects/suanfa6/cmake-build-debug/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/make -f Makefile cmTC_35616/fast && /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/cmTC_35616.dir/build.make CMakeFiles/cmTC_35616.dir/build
    Building C object CMakeFiles/cmTC_35616.dir/testCCompiler.c.o
    /Library/Developer/CommandLineTools/usr/bin/cc   -arch x86_64 -mmacosx-version-min=12.0 -MD -MT CMakeFiles/cmTC_35616.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_35616.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_35616.dir/testCCompiler.c.o -c /Users/llwh/CLionProjects/suanfa6/cmake-build-debug/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_35616
    /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E cmake_link_script CMakeFiles/cmTC_35616.dir/link.txt --verbose=1
    /Library/Developer/CommandLineTools/usr/bin/cc  -arch x86_64 -mmacosx-version-min=12.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_35616.dir/testCCompiler.c.o -o cmTC_35616 
    ld: library not found for -lSystem
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [cmTC_35616] Error 1
    make: *** [cmTC_35616/fast] Error 2
    
    

  

  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/llwh/CLionProjects/suanfa6/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/Users/llwh/CLionProjects/suanfa6/cmake-build-debug/CMakeFiles/CMakeError.log".

[无法重新加载]
 

处理办法:

①安装了xcode:

xcode-select --install

②apple官网下了插件修复

Sign In - Apple

③官网更新clion 

④参考【软件安装】mac 更新系统后 clion 软件提示 cmake 不可用解决方案_Damu-CSDN博客_clion cmake不可用

clion操作:Tools->CMake->Reset Cache and Reload CMake  重置缓存并重新加载项目

可以正常运行了。

123每步都执行下④,可能就好了 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值