首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CLion -无法在apple m1上运行程序

CLion -无法在apple m1上运行程序
EN

Stack Overflow用户
提问于 2021-05-18 09:42:00
回答 1查看 412关注 0票数 0

一个月前我运行了clion,它工作得很好。现在,当我运行一个程序时,我得到:

代码语言:javascript
复制
/bin/sh: /Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion-ARM/ch-0/203.7717.62/CLion.app/Contents/bin/cmake/mac/bin/cmake: No such file or directory
make: *** [cmake_check_build_system] Error 127

此外,在clion启动时,cmake工具窗口显示一个错误:

代码语言:javascript
复制
CMake Warning at /Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/211.7142.21/CLion.app/Contents/bin/cmake/mac/share/cmake-3.19/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):
  /Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/211.7142.21/CLion.app/Contents/bin/cmake/mac/share/cmake-3.19/Modules/CMakeSystemSpecificInitialize.cmake:21 (include)
  CMakeLists.txt:2 (project)


-- The C compiler identification is AppleClang 12.0.5.12050022
-- The CXX compiler identification is AppleClang 12.0.5.12050022
-- 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 /Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/211.7142.21/CLion.app/Contents/bin/cmake/mac/share/cmake-3.19/Modules/CMakeTestCCompiler.cmake:66 (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/a/CLionProjects/untitled1/cmake-build-debug/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/make cmTC_e3f61/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_e3f61.dir/build.make CMakeFiles/cmTC_e3f61.dir/build
    Building C object CMakeFiles/cmTC_e3f61.dir/testCCompiler.c.o
    /Library/Developer/CommandLineTools/usr/bin/cc   -arch arm64 -o CMakeFiles/cmTC_e3f61.dir/testCCompiler.c.o -c /Users/a/CLionProjects/untitled1/cmake-build-debug/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_e3f61
    "/Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/211.7142.21/CLion.app/Contents/bin/cmake/mac/bin/cmake" -E cmake_link_script CMakeFiles/cmTC_e3f61.dir/link.txt --verbose=1
    /Library/Developer/CommandLineTools/usr/bin/cc  -arch arm64 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_e3f61.dir/testCCompiler.c.o -o cmTC_e3f61 
    ld: library not found for -lSystem
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [cmTC_e3f61] Error 1
    make: *** [cmTC_e3f61/fast] Error 2

我安装了xcode命令行工具。我该怎么办?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-05-18 22:03:09

擦除cmake-build-...目录,然后重新加载CMake项目。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67578892

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档