I am working on getting access to the filesystem header from C++17, using mingw-w64 8.1 on Codeblocks. Particularly, there is a remove_all function to delete all files in a directory which would be very useful to me. I am aware that this is a known issue with Windows, reported here on SourceForge. The compile errors I get when using#include <filesystem>
and the '-lstdc++fs' flag are exactly what is reported on this page:
C:/programs/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6->rev0/mingw64/lib/gcc/x86_64-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()))
I can see that it's an error with reading Windows file paths. The last post on the bug page mentions that in order to fix the problem, 2 patches are needed.
This has been fixed in trunk:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78870
Required patches are:
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=260479https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=261034
What are the steps to actually apply these patches to my MinGW installation? Do I need to alter the libraries?