';致命错误:';wchar.h';未找到文件';新macos 11.3更新时出错 我对C++完全陌生(刚刚开始学习)。 今天我把这个MaOS更新到11.3,现在当我在CHILL中运行C++代码时,我得到这个错误, ====================[ Build | untitled | Debug ]================================ /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/nibin/CLionProjects/untitled/cmake-build-debug --target untitled -- -j 6 [ 50%] Building CXX object CMakeFiles/untitled.dir/main.cpp.o clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk' [-Wmissing-sysroot] In file included from /Users/nibin/CLionProjects/untitled/main.cpp:1: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iostream:37: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:214: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:95: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/wchar.h:119:15: fatal error: 'wchar.h' file not found #include_next <wchar.h> ^~~~~~~~~ 1 error generated. make[3]: *** [CMakeFiles/untitled.dir/main.cpp.o] Error 1 make[2]: *** [CMakeFiles/untitled.dir/all] Error 2 make[1]: *** [CMakeFiles/untitled.dir/rule] Error 2 make: *** [untitled] Error 2

';致命错误:';wchar.h';未找到文件';新macos 11.3更新时出错 我对C++完全陌生(刚刚开始学习)。 今天我把这个MaOS更新到11.3,现在当我在CHILL中运行C++代码时,我得到这个错误, ====================[ Build | untitled | Debug ]================================ /Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/nibin/CLionProjects/untitled/cmake-build-debug --target untitled -- -j 6 [ 50%] Building CXX object CMakeFiles/untitled.dir/main.cpp.o clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk' [-Wmissing-sysroot] In file included from /Users/nibin/CLionProjects/untitled/main.cpp:1: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iostream:37: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:214: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:95: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/wchar.h:119:15: fatal error: 'wchar.h' file not found #include_next <wchar.h> ^~~~~~~~~ 1 error generated. make[3]: *** [CMakeFiles/untitled.dir/main.cpp.o] Error 1 make[2]: *** [CMakeFiles/untitled.dir/all] Error 2 make[1]: *** [CMakeFiles/untitled.dir/rule] Error 2 make: *** [untitled] Error 2,c++,xcode,sdk,wchar,xcode-command-line-tools,C++,Xcode,Sdk,Wchar,Xcode Command Line Tools,我已经有了xcode工具及其最新版本。我尝试了其中一种解决方案,那就是改变路径,但仍然不起作用。所以我把文件带回了原来的位置 ➜ ~ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/ ➜ ~ xcrun --show-sdk-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/

我已经有了xcode工具及其最新版本。我尝试了其中一种解决方案,那就是改变路径,但仍然不起作用。所以我把文件带回了原来的位置

➜  ~ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
➜  ~ xcrun --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
还有另一个解决方案,我试过了,结果出了一个错误

➜  ~ open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
The file /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg does not exist.
我打开了/Library/Developer/CommandLineTools/我得到了这个

➜  ~ cd /Library/Developer/CommandLineTools
➜  CommandLineTools ls
Library SDKs    usr
一些涉及清除缓存的解决方案“删除当前项目和依赖项中的任何旧的CMakeCache.txt并重建解决了问题。”如果这听起来很愚蠢,很抱歉,但我不太明白。这是否意味着我们必须删除整个文件CMakeCache.txt,或者仅仅是其中的内容。

“我们认为
工具| CMake |重置缓存并重新加载项目
在这种情况下应该会有所帮助。” () 这对我很有用

➜  ~ cd /Library/Developer/CommandLineTools
➜  CommandLineTools ls
Library SDKs    usr