Clion for Mac v2016.3.2 cannot compile C++ code after update XCode to 8.2.1

Answered

Clion for Mac v2016.3.2 cannot compile C++ code after update XCode to  8.2.1

The error message is:

/Applications/CLion.app/Contents/bin/cmake/bin/cmake --build /Users/xxx/ClionProjects/hello/cmake-build-debug --target all -- -j 8
[ 50%] Building CXX object CMakeFiles/hello.dir/main.cpp.o
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk'
In file included from /Users/ddd/ClionProjects/hello/main.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iostream:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:215:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:90:10: fatal error: 'wchar.h' file not found
#include <wchar.h> // for mbstate_t
^
1 error generated.
make[2]: *** [CMakeFiles/hello.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/hello.dir/all] Error 2
make: *** [all] Error 2

0
5 comments
Avatar
Permanently deleted user

Is there anyone can help?

0

Please try launching the following command in terminal: xcode-select --install. Does that help?

0
Avatar
Permanently deleted user

xcode-select --install

Doesn't work. It seems XCode  8.2.1 relocate the lib and includes, that clion isn't aware of that.

0

Could you please create a new project, check if everything correctly works in it and after that launch the following action for the problematic project: 'Reset Cache and Reload Project'. Does that help?

0
Avatar
Permanently deleted user

Don't have to create a new project. 'Reload CMake Project' will fix the problem.

Thank you for your help.

0

Please sign in to leave a comment.