Clion doesnt compile on MacOS sequoia
Answered
After I updated my macOS to 15.0 sequoia, Clion cant compile, debug or run my projects. I already tried to search in the forum for some solution but I could not resolve this problem.
Please sign in to leave a comment.
Hello!
What build system is your project based on?
If it's CMake, please do `Tools | CMake | Reset Cache and Reload Project` and provide the entire output from the CMake tool window.
/Applications/CLion.app/Contents/bin/cmake/mac/aarch64/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/Applications/CLion.app/Contents/bin/ninja/mac/aarch64/ninja -G Ninja -S "/Users/emil/CLionProjects/uge 4/untitled" -B "/Users/emil/CLionProjects/uge 4/untitled/cmake-build-debug"
-- The C compiler identification is unknown
-- The CXX 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/aarch64/share/cmake-3.29/Modules/CMakeTestCCompiler.cmake:67 (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/emil/CLionProjects/uge 4/untitled/cmake-build-debug/CMakeFiles/CMakeScratch/TryCompile-qSPDRT'
Run Build Command(s): /Applications/CLion.app/Contents/bin/ninja/mac/aarch64/ninja -v cmTC_296d5
[1/2] /usr/bin/cc -arch arm64 -o CMakeFiles/cmTC_296d5.dir/testCCompiler.c.o -c '/Users/emil/CLionProjects/uge 4/untitled/cmake-build-debug/CMakeFiles/CMakeScratch/TryCompile-qSPDRT/testCCompiler.c'
FAILED: CMakeFiles/cmTC_296d5.dir/testCCompiler.c.o
/usr/bin/cc -arch arm64 -o CMakeFiles/cmTC_296d5.dir/testCCompiler.c.o -c '/Users/emil/CLionProjects/uge 4/untitled/cmake-build-debug/CMakeFiles/CMakeScratch/TryCompile-qSPDRT/testCCompiler.c'
xcode-select: note: No developer tools were found, requesting install.
If developer tools are located at a non-default location on disk, use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, and cancel the installation dialog.
See `man xcode-select` for more details.
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!
[Failed to reload]
The error says “No developer tools were found, requesting install”. Please install them - https://www.jetbrains.com/help/clion/quick-tutorial-on-configuring-clion-on-macos.html#reqtools.
Thank you so much Anna!
I am having the same problem, but I have XCode Command Line Tools already installed. Even the stock “Hello World” template is throwing errors saying that iostream cannot be found.
Thomas Rossi , please do `Tools | CMake | Reset Cache and Reload Project` and past here the entire output from the CMake tool window.
/Users/trossi/Applications/CLion.app/Contents/bin/cmake/mac/aarch64/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/Users/trossi/Applications/CLion.app/Contents/bin/ninja/mac/aarch64/ninja -G Ninja -S /Users/trossi/CLionProjects/ErrorTest -B /Users/trossi/CLionProjects/ErrorTest/cmake-build-debug -- The C compiler identification is AppleClang 16.0.0.16000026 -- The CXX compiler identification is AppleClang 16.0.0.16000026 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done (1.1s) -- Generating done (0.0s) -- Build files have been written to: /Users/trossi/CLionProjects/ErrorTest/cmake-build-debug [Finished]
Thomas Rossi , the output looks fine. Do you still observe the issue?
Yes, the error output is as follows:
/Users/trossi/Applications/CLion.app/Contents/bin/cmake/mac/aarch64/bin/cmake --build /Users/trossi/CLionProjects/ErrorTest/cmake-build-debug --target ErrorTest -j 6
[1/2] Building CXX object CMakeFiles/ErrorTest.dir/main.cpp.o
FAILED: CMakeFiles/ErrorTest.dir/main.cpp.o
/Library/Developer/CommandLineTools/usr/bin/c++ -g -std=gnu++20 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk -fcolor-diagnostics -MD -MT CMakeFiles/ErrorTest.dir/main.cpp.o -MF CMakeFiles/ErrorTest.dir/main.cpp.o.d -o CMakeFiles/ErrorTest.dir/main.cpp.o -c /Users/trossi/CLionProjects/ErrorTest/main.cpp
/Users/trossi/CLionProjects/ErrorTest/main.cpp:1:10: fatal error: 'iostream' file not found
1 | #include <iostream>
| ^~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
If it helps, order to compile I have found that I need to use “-isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 ” when invoking the compiler via the command line.
Please in the Terminal execute
sudo xcode-select -switch /Library/Developer/CommandLineTools/
, after that necessarily doTools | CMake | Reset Cache and Reload Project
in CLion.If it doesn't help, please reinstall Xcode command line developer tools: uninstall them using
sudo rm -rf /Library/Developer/CommandLineTools
and then install again by executingxcode-select --install
. After that, remove thecmake-build-debug
subdirectory from your project and doTools | CMake | Reset Cache and Reload Project
in CLion.i got the same problem too
/Users/test/Applications/CLion.app/Contents/bin/cmake/mac/aarch64/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/Users/test/Applications/CLion.app/Contents/bin/ninja/mac/aarch64/ninja -G Ninja -S /Users/test/CLionProjects/untitled -B /Users/test/CLionProjects/untitled/cmake-build-debug
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) in CMakeLists.txt:
cmake_minimum_required() should be called prior to this top-level project()
call. Please see the cmake-commands(7) manual for usage documentation of
both commands.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is AppleClang 16.0.0.16000026
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.5s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/test/CLionProjects/untitled/cmake-build-debug
[Finished]
Sunthorn Ko, the problem you faced doesn't look the same. In your case, the warning is "CMake Warning (dev) in CMakeLists.txt:
No project() command is present". Please check if there is a
project()
command in your CMakeLists.txt.I have the same problem.
Reason: The header path on mac is ‘/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk’, but Clion requires ‘/usr/include’.
ways of resolution: Add config on Cmake.txt.
include_directories("/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1")
include_directories("/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include")