首页 > 解决方案 > Mojave 更新后出现“make”问题:致命错误:找不到“wchar.h”文件

问题描述

在我的 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

文件 wchar.h 位于该目录中,但找不到。

我在较早的 Macos 更新后遇到过这个问题,但可以通过..

macOS 'wchar.h' 文件未找到

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

sudo xcode-select --switch /Library/Developer/CommandLineTools/

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

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

对此有任何想法!

标签: macosmakefilemacos-mojave

解决方案


不确定它是否是一个通用的解决方案,但设置CPLUS_INCLUDE_PATH为以下对我有用:

export CPLUS_INCLUDE_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"

祝你好运!


推荐阅读