windows10でmsys2を入れclangをインストールしました。
そして以下のコードをコンパイルするとエラーを吐きます。
C++
1#include <filesystem> 2 3int main() 4{ 5 return 0; 6}
結果
clang++ -std=c++2a -o bin.exe src\main.cpp In file included from src\main.cpp:1: In file included from C:\msys64\mingw64\include\c++\9.2.0\filesystem:37: C:\msys64\mingw64\include\c++\9.2.0\bits/fs_path.h:636:31: error: invalid use of incomplete type 'std::filesystem::__cxx11::filesystem_error' _GLIBCXX_THROW_OR_ABORT(filesystem_error( ^~~~~~~~~~~~~~~~~ C:\msys64\mingw64\include\c++\9.2.0\x86_64-w64-mingw32\bits/c++config.h:177:49: note: expanded from macro '_GLIBCXX_THROW_OR_ABORT' # define _GLIBCXX_THROW_OR_ABORT(_EXC) (throw (_EXC)) ^~~~ C:\msys64\mingw64\include\c++\9.2.0\bits/fs_fwd.h:61:9: note: forward declaration of 'std::filesystem::__cxx11::filesystem_error' class filesystem_error;
-std=c++2aをc++17にしても同じ結果ですが、c++14、または削除するとコンパイルが通ります。
どうすれば-std=c++2aのままでコンパイルが通るようになるでしょうか。
msys2のg++で同じようにコンパイルすると通ってくれます。
追記:バージョン
clang++ --version clang version 8.0.1 (tags/RELEASE_801/final) Target: x86_64-w64-windows-gnu Thread model: posix InstalledDir: C:\msys64\mingw64\bin
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/08/13 10:36
2019/08/13 10:42
2019/08/13 11:00
2019/08/13 11:03
2019/08/13 11:17