updated CLion on mac(m1) and got this error, please help me solve

已完成

"/Users/andrejzubrickij/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/213.6777.58/CLion.app/Contents/bin/cmake/mac/bin/cmake" -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_MAKE_PROGRAM=/Users/andrejzubrickij/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/213.6777.58/CLion.app/Contents/bin/ninja/mac/ninja" -G Ninja /Users/andrejzubrickij/CLionProjects/untitled4
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- 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/andrejzubrickij/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/213.6777.58/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/andrejzubrickij/CLionProjects/untitled4/cmake-build-debug/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/Users/andrejzubrickij/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/213.6777.58/CLion.app/Contents/bin/ninja/mac/ninja cmTC_fa92e && [1/2] Building C object CMakeFiles/cmTC_fa92e.dir/testCCompiler.c.o
    [2/2] Linking C executable cmTC_fa92e
    FAILED: cmTC_fa92e 
    : && /Library/Developer/CommandLineTools/usr/bin/cc -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/cmTC_fa92e.dir/testCCompiler.c.o -o cmTC_fa92e   && :
    ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd, missing required architecture arm64 in file /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd
    ld: dynamic main executables must link with libSystem.dylib for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    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/andrejzubrickij/CLionProjects/untitled4/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/Users/andrejzubrickij/CLionProjects/untitled4/cmake-build-debug/CMakeFiles/CMakeError.log".

[Finished]

0

Hello!

Does `Tools | CMake | Reset Cache and Reload Project` help?

1

Please try the following:

Does it work?

1

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`. 

If it doesn't help, do Help | Collect Logs and Diagnostic Data and send the resulted archive to clion-support at jetbrains.com among with the link to this thread. Note that logs might contain private user's information (like file paths and names).

1

Marinaribeiro Na have you tried executing `xcode-select --install` in Terminal, and after that `Tools | CMake | Reset Cache and Reload Project` in CLion?

1

Thanks Anna Falevskaya. It works after I tried:

  • execute `xcode-select --install` in Terminal
  • execute `export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)`

  • `Tools | CMake | Reset Cache and Reload Project` in CLion
1

Please go to `Preferences | Advanced Settings`, enable the “Use legacy generator for CMake 3.20 and higher” option, and then do `Tools | CMake | Reset Cache and Reload Project`. Does that help?

0

Anna Falevskaya 

I already stood Use legacy generator for CMake 3.20 and higher” but i tried your method anyway but it didn't help

0

"/Applications/CLion 2022.1 EAP.app/Contents/bin/cmake/mac/bin/cmake" -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_MAKE_PROGRAM=/Applications/CLion 2022.1 EAP.app/Contents/bin/ninja/mac/ninja" -G Ninja -S /Users/andrejzubrickij/CLionProjects/untitled4 -B /Users/andrejzubrickij/CLionProjects/untitled4/cmake-build-debug
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- 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 2022.1 EAP.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/andrejzubrickij/CLionProjects/untitled4/cmake-build-debug/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/Applications/CLion 2022.1 EAP.app/Contents/bin/ninja/mac/ninja cmTC_27516 && [1/2] Building C object CMakeFiles/cmTC_27516.dir/testCCompiler.c.o
    [2/2] Linking C executable cmTC_27516
    FAILED: cmTC_27516 
    : && /Library/Developer/CommandLineTools/usr/bin/cc -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/cmTC_27516.dir/testCCompiler.c.o -o cmTC_27516   && :
    ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd, missing required architecture arm64 in file /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd
    ld: dynamic main executables must link with libSystem.dylib for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    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/andrejzubrickij/CLionProjects/untitled4/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/Users/andrejzubrickij/CLionProjects/untitled4/cmake-build-debug/CMakeFiles/CMakeError.log".

[Finished]

 

no it didn't help

0

 

the only thing is that such a window began to appear

0

hi Zubritskiyav ,

wondering if you managed to resolve this?

I'm with the same error appearing, not sure what to do :/

0

Anna Falevskaya yes, and I was facing the issue of Terminal telling me that Xcode is already installed with the errors still appearing in CLion.

What helped though was the following: I deleted Xcode, deleted the Developer folder and re-installed XCode afterwards. and then "reset cache and reload project"  worked :)

Thanks!

0

It actually works now thanks Anna Falevskaya.

0

请先登录再写评论。