3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Macでwchar.hが見つからないとき

Last updated at Posted at 2019-11-08

概要

久しぶりにg++でビルドしようとしたら以下のエラーが出た

In file included from /usr/local/Cellar/gcc/9.1.0/include/c++/9.1.0/bits/postypes.h:40,
                 from /usr/local/Cellar/gcc/9.1.0/include/c++/9.1.0/iosfwd:40,
                 from /usr/local/Cellar/gcc/9.1.0/include/c++/9.1.0/ios:38,
                 from /usr/local/Cellar/gcc/9.1.0/include/c++/9.1.0/ostream:38,
                 from /usr/local/Cellar/gcc/9.1.0/include/c++/9.1.0/iostream:39,
                 from main.cpp:1:
/usr/local/Cellar/gcc/9.1.0/include/c++/9.1.0/cwchar:44:10: fatal error: wchar.h: No such file or directory
   44 | #include <wchar.h>
      |          ^~~~~~~~~
compilation terminated.

解決方法

まずはXcodeの確認をしましょう。

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

Xcodeの方は問題なさそうなのでhomebrewでgccを再インストールします。

$ brew reinstall gcc

解決しました. バージョン変更があったようです. アプデ後は気をつけましょう。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?