Both libc++ and libstdc++ have a std::experimental::filesystem in recent versions. I'm unaware of either having std::filesystem directly; C++17 isn't released quite yet, that seems reasonable.
boost has boost::filesystem, which differs in a few ways but is structured nearly identically. Code written to use boost::filesystem can be relatively easily ported to std::filesystem.
As an example of an incompatibility, boost has a singular flag enum, while std has a plural flag enum bitfield with more settings.
You may have to pass -std=c++1z to the compiler, check your libc++ or libstdc++ version, switch which one you are using, install a new one, etc. Or install boost, and use its filesystem library which C++17s was based off of.