Mojave更新"make"后出现问题:致命错误:找不到'wchar.h'文件

E E*_*E E 6 macos makefile macos-mojave

我的Mojave更新后,从终端运行"make"时出现错误:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/wchar.h:119:15: fatal error: 'wchar.h' file not found
Run Code Online (Sandbox Code Playgroud)

文件wchar.h位于该目录中,但无法找到.

在早期的Macos更新之后,我遇到过这个问题,但是可以用...

macOS'wchar.h'找不到文件

但这次没有任何作用.我已经重新安装了xcode 10和xcode-selected,并且还切换到了新文件夹..

sudo xcode-select --switch /Library/Developer/CommandLineTools/
Run Code Online (Sandbox Code Playgroud)

它仍然在文件夹中搜索wchar.h

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/

任何想法!

Jen*_*nny 9

不确定它是否是一个通用的解决方案,但设置CPLUS_INCLUDE_PATH如下为我做了诀窍:

export CPLUS_INCLUDE_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"
Run Code Online (Sandbox Code Playgroud)

祝好运!