I am trying to compile a simple C++ program with std::filesytem header file included!
#include <iostream> #include <filesystem> int main() { std::cout << "Hello, World!" << std::endl; return 0; } On compiling I get the following error
In file included from C:/PROGRA~1/MINGW-~1/X86_64~2.0-W/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/filesystem:37, from C:\Users\{User}\CLionProjects\untitled3\main.cpp:2: C:/PROGRA~1/MINGW-~1/X86_64~2.0-W/mingw64/lib/gcc/x86_64-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:/PROGRA~1/MINGW-~1/X86_64~2.0-W/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 am on windows OS using MingW 8.1.0 and Clion as the IDE and as depicted on this https://en.cppreference.com/w/cpp/compiler_support seems like GCC 8.1 already supports std:fileystem
EDIT: Language level is set in my CMakeList as shown below
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 17)@Vivick