Clion doesn't compile on MACOS Mojave 10.14


After updating high sierra to mojave 10.14 , it stopped compiling and gives the following error. 

"xcode-select --install" is not working. 



Could you please reload CMake project? We suppose that `Tools | CMake | Reset Cacheand reload project should help in this case.


I tried, but it didn't work. 


It finally works. Just remove the command line tools by 

sudo rm -rf /Library/Developer/CommandLineTools
and re-install it. 

I did all. But, I got a new problem.


@Trmasha2015, please do "xcode-select --install" in the terminal. What result do you get?

Please provide a screenshot of Preferences | Build, Execution, Deployment | Toolchains after doing "xcode-select --install".


@Trmasha2015, as you can see, CLion can't detect compilers from the command line tools. Have you performed "xcode-select --install" in the terminal? Have you tried reinstalling the command line tools?


Yes I tried. But, nothing changed


Do you have /Library/Developer/CommandLineTools/usr/bin/c++ and /Library/Developer/CommandLineTools/usr/bin/cc?


As an experiment, please do the following:

1. Create a new default "C++ Executable" project in CLion.

2. Go to Preferences | Build, Execution, Deployment | Toolchains and specify /Library/Developer/CommandLineTools/usr/bin/cc and /Library/Developer/CommandLineTools/usr/bin/c++ as C and C++ compilers.

3. Do `Tools | CMake | Reset Cache and Reload Project`.

Does CLion build this project successfully after that?


Yes. Thank you very much=)


Hello, none of the regular cpp library like #include <cmath> is being included properly 

I've tried everything mentioned above. ran 'sudo -rf  /Library/Developer/CommandLineTools' and 'xcode-select --install'

,reload CMake project and changed my C and Cpp compilers as indicated. 



nevermind, I got it working by restarting clion again


Having the same issue after xcode removed from my system. and resting cmake cache works, thanks to Anna Filippova


@... I'm raising this issue again. 

CLion 2020.1
Build #CL-201.6668.126, built on April 9, 2020
Runtime version: 11.0.6+8-b765.25 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.4
GC: ParNew, ConcurrentMarkSweep
Memory: 1987M
Cores: 8
Registry: run.processes.with.pty=TRUE

I re-installed the Xcode Toolchain and reset CMake cache but still nothing helps. What I consider suspicious is that in Toolchains I manually set path to C and C++ compilers as `/Library/Developer/CommandLineTools/usr/bin/cc` and `/Library/Developer/CommandLineTools/usr/bin/c++` appropriately, but in the error output I see like `/Applications/` making me guess that my manual setting is not important. Can you suggest something, please?

In general, I see errors like:

error: unknown type name '__builtin_constant_p'
short ntohs(const short word);


Please sign in to leave a comment.