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?
The good news is that MinGW is still available on MinGW - Minimalist GNU for Windows download | SourceForge.net. Note that the maintainer announced on the homepage: This project is in the process of moving to osdn.net/projects/mingw, you can continue to follow us there.
MinGW-w64 is a improved version which supports both 32bit and 64bit, and some more of the WinAPI (still not all, because thats much work, but more than MinGW). MinGW-w64 only provides their source code, but no binaries to "just use" the compiler.
The MinGW from http://www.mingw.org/ does only support gcc 32 bit (host and target). The independent minGW-w64 project provides support for 64 bit, and also supports a much larger part of the Windows API.
1 Answer. Show activity on this post. g++ 4.8 simply does not support C++14, also MinGW is quite outdated when there are more new versions of gcc.
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
So, I am going to give you the full proof solution for this similar error which also comes when someone tries to use the STL header file which is #include<bits/stdc++.h>
So, this error is occurring because you are currently using the GCC version 8.2.0 which is the default on the MinGW website. To solve this problem you need to update to GCC 10.2.0
Following are the steps you need to follow:- 1.) Download and install the Msys2 from https://www.msys2.org/ 2.) Run or launch this and type pacman -Syu and hit enter then it will ask you to continue by typing Y/N just type enter without pressing Y/n. 3.) Close this and again launch msys2 at least run this command 2-3 times until it shows nothing to do with or nothing to update. 4.) For doing the same I am also sharing a link to the youtube video. https://www.youtube.com/watch?v=aXF4A5UeSeM&
5.) For checking that you have successfully installed GCC 10.2.0 just open cmd and type GCC --version and hit enter if it is showing 10.2.0 hurray u did it, wait this is not the end. 6.) Now uninstall Clion or any IDE which you are using. 7.) Before reinstalling it you need to delete some of the remaining Jetbrains dump files which are showing in your program files folder (name Jetbrains) Delete that folder and Reinstall it. 8.) Now select Msys2/MingW-64, not the previous one which you have in your system already (normal MinGW) while installing it. 9.) Now You can go to your add or remove program section and can delete that waste normal MinGW-64, not the msys2 (don't delete msys2) only delete ming64 the previous one. 10.) Now you can enjoy running that sexy stl library without having any error.
Still, you have any problem doing these steps just ask me in the comment. Thanks, Guys.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With