I'm following this tutorial:
http://www.bfilipek.com/2017/08/cpp17-details-filesystem.html
to checkout new c++ filesystem feature. However I'm unable to compile even minimal example on my machine:
#include <string>
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;
int main()
{
std::string path = "/";
for (auto & p : fs::directory_iterator(path))
std::cout << p << std::endl;
}
I was using XCode, CLion and command line while trying to compile it but nothing works, I have Version 9.3 (9E145) with (seemingly proper) project settings, none of which work:
Here is my CMakeLists.txt file for CLion:
cmake_minimum_required(VERSION 3.8)
project(FileSystem2)
set(CMAKE_CXX_STANDARD 17)
add_executable(FileSystem2 main.cpp)
Here is an output from > gxx --version:
Nevertheless this is what I get as an output from my IDEs:
What am I doing wrong, it looks to me that my compiler should support c++17?
Edit
As per Owen Morgan's answer I've installed clang (actual install command was brew install llvm) but it now complains about absence of string.h. Any thoughts?





