[メモ] fatal error: 'wchar.h' file not found
ビルドエラーの修正履歴
macOSで今までビルドできていたプログラムがビルドできなくなって、以下のようなビルドエラーが発生する時のメモ。CommandLineToolsのSDKが変わってしまったらしい。
#include_next <wchar.h>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/wchar.h: ^~~~~~~~~118
:15: fatal error: 'wchar.h' file not found
環境
macOS Catalina (10.15.7)
XCode12.3
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
作業
https://github.com/phracker/MacOSX-SDKs/releases からMacOSX10.15.sdk.tar.xzをダウンロードして、
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs にコピー。
cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
sudo tar xvf MacOSX10.15.sdk.tar.xz
sudo rm MacOSX10.15.sdk.tar.xz
MacOSX.sdkのリンク修正
ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk'
以上で再びビルドできるようになった。
Author And Source
この問題について([メモ] fatal error: 'wchar.h' file not found), 我々は、より多くの情報をここで見つけました https://qiita.com/mktshhr/items/03ade60ca50d99555705著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .