1
1

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.

bits/stdc++.hを入れたら「/usr/local/include/bits/stdc++.h:57:10: fatal error: 'cstdalign' file not found」が表示されてしまう

Posted at

タイトルの通りです。
Macでbits/stdc++.hを導入してタイトルエラーが出てきた場合の対処法をメモします。

macbook:cpputil dynaonda$ g++ -std=c++14 main.cc 
In file included from main.cc:1:
/usr/local/include/bits/stdc++.h:57:10: fatal error: 'cstdalign' file not found
# include <cstdalign>
         ^~~~~~~~~~~
1 error generated.

対処方法

  1. stdc++.hを下のリンク2からダウンロードします。
  2. /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1にコピーします。
    3. インクルード先を変更しているならそちらにもコピーします。

これで解決しました。

リンク

  1. https://www.quora.com/The-header-file-“bits-stdc++-h”-is-not-working-on-my-OSX-How-to-make-it-work
  2. https://gist.github.com/frankchen0130/9ac562b55fa7e03689bca30d0e52b0e5#file-stdc-h
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?