问题
2 days ago, I was excited to note that MinGW-w64 released its gcc 8.1.0, revision 0. Unfortunately, a simple program
#include <filesystem>
int main() {}
does not compile. It results in a bunch of errors inside <filesystem>
, starting with
C:/MinGW/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/bits/fs_path.h: In member function 'std::filesystem::__cxx11::path& std::filesystem::__cxx11::path::operator/=(const std::filesystem::__cxx11::path&)':
C:/MinGW/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/bits/fs_path.h:237:47: error: no match for 'operator!=' (operand types are 'std::filesystem::__cxx11::path' and 'std::filesystem::__cxx11::path')
|| (__p.has_root_name() && __p.root_name() != root_name()))
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
Who's to blame for that? Or better, to whom is that error to report?
回答1:
This problem could be due to the gcc distribution (mingw-w64) or to the compiler itself (gcc).
As first, more likely hypothesis I think it could be an issue of the distribution, so I have just added it as a bug to the sourceforge website of mingw-w64.
https://sourceforge.net/p/mingw-w64/bugs/737/
If they find that's a problem of gcc, this could be readdressed to the compiler website (gcc.gnu.org).
Let's wait and see what they answer on sourceforge.
Marco
回答2:
This is a problem between c++17 and file system, perhaps this link will help. issue regarding MinGW-w64 8.1.0 compile issue
来源:https://stackoverflow.com/questions/50546025/mingw-w64-8-1-0-rev-0-doesnt-compile-when-including-filesystem