Clion doesn't compile on MACOS Mojave 10.14

Completed

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



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

 

1
16 comments

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

1
Avatar
Permanently deleted user

I tried, but it didn't work. 

0
Avatar
Permanently deleted user

It finally works. Just remove the command line tools by 

sudo rm -rf /Library/Developer/CommandLineTools
and re-install it. 
0
Avatar
Permanently deleted user

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

0

@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".

1
Avatar
Permanently deleted user

0

@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?

1
Avatar
Permanently deleted user

Yes I tried. But, nothing changed

0

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

1
Avatar
Permanently deleted user

Yes I have.

0

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?

1
Avatar
Permanently deleted user

Yes. Thank you very much=)

0
Avatar
Permanently deleted user

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. 

 

0
Avatar
Permanently deleted user

nevermind, I got it working by restarting clion again

0

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

0

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/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/_endian.h` 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);

0

Please sign in to leave a comment.